已安装Hive,但在运行

时间:2016-03-31 07:49:59

标签: apache ubuntu hadoop installation hive

我使用this教程安装了HIVE。但是,当我运行下面的commad

hive

我收到此错误

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)

以及许多其他例外情况。

编辑1找不到hive-site.xml

这就是我的conf文件夹的样子http://postimg.org/image/vloi2vneh/

编辑2 回答这个问题不是在下面,而是在聊天,因为它很长

1 个答案:

答案 0 :(得分:2)

如输出消息中所示,您正在使用本地Metastore Derby数据库,默认情况下其位置为/usr/lib/hive/apache-hive-2.0.0-bin/metastore_db,但显然您没有在该目录上写入的权限

您应该将Metastore目录更改为您具有写入权限的位置。

要更改Metastore目录的位置,请在hive-site.xml添加(或修改)以下属性:

<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>

如果您没有更改hive-site.xml的权限,可以将hive-site.xml放在例如$HOME/hive-config的目录中,您可以先复制默认的hive-site.xml,然后修改它。然后开始配置为:

$ 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/
相关问题