java.sql.SQLException:无法在hive中启动数据库'/ var/lib/hive/metastore/metastore_db'

Spa*_*ami 1 hadoop

我是蜂巢的首发.当我尝试执行任何配置单元命令时:

hive>SHOW TABLES;

它显示以下错误:

FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Failed to start database '/var/lib/hive/metastore/metastore_db', see the next exception for details.
NestedThrowables:
java.sql.SQLException: Failed to start database '/var/lib/hive/metastore/metastore_db', see the next exception for details.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
Run Code Online (Sandbox Code Playgroud)

Sac*_*inJ 5

它看起来像德比锁定问题.您可以通过删除目录中的锁定文件来临时解决此问题/var/lib/hive/metastore/metastore_db.但是这个问题也将在未来发生

sudo rm -rf /var/lib/hive/metastore/metastore_db/*.lck

使用默认的hive Metastore嵌入式derby时,无法同时启动多个hive实例.通过将hive Metastore更改为mysql或postgres服务器,可以解决此问题.

有关更改hive Metastore的信息,请参阅以下cloudera文档

http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/4.2.0/CDH4-Installation-Guide/cdh4ig_topic_18_4.html