首页 文章

无法创建数据库路径文件:/ user / hive / warehouse错误

提问于
浏览
3

我有一个3节点集群,我在运行一些HIVE查询时遇到以下错误

FAILED:元数据错误:MetaException(消息:无法创建数据库路径文件:/user/hive/warehouse/db_dut.db,无法创建数据库db_dut)FAILED:执行错误,从org.apache.hadoop返回代码1 . hive.ql.exec.DDLTask

我的hive-site.xml包含以下属性

<property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true</value>
      <description>JDBC connect string for a JDBC metastore</description>
    </property>

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>/user/hive/warehouse</value>
  <description>location of default database for the warehouse</description>
</property>

>jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true< 正确出现在我的本地计算机上 .

当我给hadoop fs -ls / user / hive ...后来输出来了

[root@scaj02bda01 metastore]# hadoop fs -ls /user/hive
Found 1 items
drwxrwxrwx   - hive hive          0 2013-04-09 01:40 /user/hive/warehouse
[root@scaj02bda01 metastore]#

HDFS中正确提到了仓库的默认数据库位置,并具有所有读写执行权限,但仍然遇到相同的错误 .

1 回答

  • 3

    它说它无法打开数据库/ var / lib / hive / metastore / metastore_db,当你没有权限访问数据库时,通常会出现此错误 . 使用下面的commond然后回复我:

    1)SUDO chmod -R 777 / VAR / LIB / HIVE / METASTORE / METASTORE_DB

    2)chmod -R a rwx / var / lib / hive / metastore / metastore_db

    3)rm /var/lib/hive/metastore/metastore_db/*.lck

相关问题