Legendary_Hunter
Legendary_Hunter

Reputation: 1080

Hive installed but giving error when running

I have installed HIVE using this tutorial. But when I run the folowing commad

hive

I get this error

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/lib/hive/apache-hive-2.0.0-bin/lib/hive-jdbc-2.0.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/lib/hive/apache-hive-2.0.0-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Logging initialized using configuration in jar:file:/usr/lib/hive/apache-hive-2.0.0-bin/lib/hive-common-2.0.0.jar!/hive-log4j2.properties Thu Mar 31 13:11:06 IST 2016 Thread[main,5,main] java.io.FileNotFoundException: derby.log (Permission denied) Thu Mar 31 13:11:06 IST 2016 Thread[main,5,main] Cleanup action starting ERROR XBM0H: Directory /usr/lib/hive/apache-hive-2.0.0-bin/metastore_db cannot be created. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source) at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)

and many other exceptions.

EDIT 1 Cannot find hive-site.xml

This is what my conf folder looks like http://postimg.org/image/vloi2vneh/

EDIT 2 ans wer to this question is not below but in chats because it is very long

Upvotes: 0

Views: 6310

Answers (1)

user1314742
user1314742

Reputation: 2924

As it appears in the output message , you are using local metastore Derby database, and by default its location is /usr/lib/hive/apache-hive-2.0.0-bin/metastore_db, but apparently you do not have the permission to write on that directory

You should change the metastore directory to some location where you have the write permission.

To change the location of metastore directory, in hive-site.xml add (or modifiy) the following property:

<property>
   <name>javax.jdo.option.ConnectionURL</name>
   <value>jdbc:derby:;databaseName=/PATH/TO/NEW/METASTORE/DIR/metastore_db;create=true</value>
   <description>JDBC connect string for a JDBC metastore</description>
</property>

If you do not have the permission to change hive-site.xml, you could put hive-site.xml in a directory for example $HOME/hive-config, you could start by copying the default hive-site.xml , and then modify it. Then start hive as:

$ cp /usr/lib/hive/apache-hive-2.0.0-bin/conf/hive-default.xml.template $HOME/hive-config/hive-site.xml
###Modify the new hive-site.xml as mentioned above, then:
$hive --config $HOME/hive-config/

Upvotes: 2

Related Questions