【问题标题】:Hive installed but giving error when runningHive 已安装但运行时出错
【发布时间】:2016-03-31 07:49:59
【问题描述】:

我已经使用this 教程安装了 HIVE。但是当我运行以下命令时

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)

还有许多其他例外。

EDIT 1 找不到 hive-site.xml

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

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

【问题讨论】:

    标签: apache ubuntu hadoop installation hive


    【解决方案1】:

    正如输出消息中显示的那样,您正在使用本地 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,然后修改.然后将 hive 启动为:

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

    【讨论】:

    • 我不想用 derby 代替我想用 HBASE 所以我应该先安装 HBASE 然后纠正这个错误吗?
    • 我想我解释错了。 Derby 是您的元存储,您在其中拥有有关 Hive 表的元数据,它与您要使用的实际数据无关。 Metastore 数据库可以是 Derby 或以下之一:MySQL、Postgres、Oracle 或 MS SQL Server cwiki.apache.org/confluence/display/Hive/…
    • 对于将 Hive 与 HBase 数据一起使用,这是另一个问题 :) 你可以先看看这里(但当然你需要解决你的问题 :)):cwiki.apache.org/confluence/display/Hive/HBaseIntegration。您遇到的错误与 HBase 无关,但是您当然需要安装一些客户端库以使 Hive 与 HBase 连接
    • 我找不到名为 hive-site.xml 的文件,而是找到了一个名为 proto-hive-site.xml 的文件。它有以下内容&lt;property&gt; &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt; &lt;value&gt;jdbc:mysql://DBHOSTNAME/hivemetastoredb?createDatabaseIfNotExist=true&lt;/value&gt; &lt;description&gt;JDBC connect string for a JDBC metastore&lt;/description&gt; &lt;/property&gt;我走对了吗?
    • 我在我的 conf 文件夹中看不到 hive-site.xml。我已按问题编辑以显示我可以在我的 conf 文件夹中看到的所有文件
    猜你喜欢
    • 1970-01-01
    • 2016-06-28
    • 1970-01-01
    • 2015-05-15
    • 1970-01-01
    • 2019-11-05
    • 2015-06-08
    • 1970-01-01
    • 2018-11-11
    相关资源
    最近更新 更多