在配置单元中创建表异常? [英] Create table exception in hive?
问题描述
我已经安装了 Hive,但是当我编写命令来创建表CREATE TABLE foo(id int, msg STRING);"时.我抛出异常清理操作已完成失败:元数据中的错误:javax.jdo.JDOFatalDataStoreException:无法创建数据库metastore_db",有关详细信息,请参阅下一个异常.NestedThrowables:java.sql.SQLException:无法创建数据库metastore_db",有关详细信息,请参阅下一个异常.FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask".为什么会出现这个异常,要么是配置问题,要么是别的什么.
i have installed Hive, but when i write command to create table "CREATE TABLE foo(id int, msg STRING);". I throws Exception "Cleanup action completed FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Failed to create database 'metastore_db', see the next exception for details.NestedThrowables:java.sql.SQLException: Failed to create database 'metastore_db', see the next exception for details.FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask". Why this exception is occur, either it is configuration problem or something else.
推荐答案
我遇到了同样的问题:
voicestreams@voicestreams:~/testbed/eclipseprojects/workspace/mapreducesort/java$ hive
voicestreams@voicestreams:~/testbed/eclipseprojects/workspace/mapreducesort/java$ hive
Hive 历史文件=/tmp/root/hive_job_log_root_201210282200_1123208966.txt
Hive history file=/tmp/root/hive_job_log_root_201210282200_1123208966.txt
hive> 显示表格
FAILED:元数据错误:javax.jdo.JDOFatalDataStoreException:无法创建数据库/var/lib/hive/metastore/metastore_db",有关详细信息,请参阅下一个异常.嵌套的Throwables:java.sql.SQLException: 无法创建数据库 '/var/lib/hive/metastore/metastore_db',有关详细信息,请参阅下一个异常.失败:执行错误,从 org.apache.hadoop.hive.ql.exec.DDLTask 返回代码 1
FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Failed to create database '/var/lib/hive/metastore/metastore_db', see the next exception for details. NestedThrowables: java.sql.SQLException: Failed to create 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
我已经使用 apt-get install hadoop-hive 安装了 Hive.在我从/var/lib/hive/移动了 Metastore 之后它工作了.我通过编辑做到了:/etc/hive/conf.dist/hive-site.xml
I had installed Hive using apt-get install hadoop-hive. It worked after i moved the metastore from /var/lib/hive/. I did that by editing: /etc/hive/conf.dist/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>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=/home/voicestreams/hive/metastore/metastore_db;create=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
`
基本上,我将 databaseName= 更改为可写目录 (/home/voicestreams/hive/) 并且它起作用了.当然,在再次运行 hive 之前,我必须创建/home/voicestreams/hive/.希望这会有所帮助.
Basically, i changed the databaseName= to a writable directory (/home/voicestreams/hive/) and it worked. Of course, i had to create /home/voicestreams/hive/ before running hive again.Hope this helps.
这篇关于在配置单元中创建表异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!