Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeExcept

参考:http://mars914.iteye.com/blog/1410035


hive-site.xml 修改如下配置

复制代码
<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localhost:3306/hivedb?createDatabaseIfNotExist=true</value>
    <!--jdbc:mysql://localhost:3306/hivedb(hivedb为在mysql中要创建的hive名称)?-->
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <!--mysql-connector-java-5.1.10-bin.jar 的版本,不需要和mysql的版本一致-->
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>root<!--链接mysql的用户名--></value>
  <description>username to use against metastore database</description>
</property>


<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>root<!--链接mysql的密码--></value>
  <description>password to use against metastore database</description>
</property>
复制代码

 报错:

hive> show tables;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. 
java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient


用如下命令输出详细错误信息

复制代码
$hive -hiveconf hive.root.logger=DEBUG,console

14/11/25 17:18:47 ERROR exec.DDLTask: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: 
Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient ... Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient ... Caused by: java.lang.reflect.InvocationTargetException ... Caused by: MetaException(message:Version information not found
in metastore. )
复制代码


此时登录mysql,在hive-site.xml配置的hivedb数据库已经创建,说明mysql链接正常

参考:http://www.micmiu.com/bigdata/hive/hive-default-setup/

修改hive-site.xml,进行如下配置:

复制代码
<property>
  <name>hive.metastore.schema.verification</name>
  <value>false</value>
   <description>
   Enforce metastore schema version consistency.
   True: Verify that version information stored in metastore matches with one from Hive jars.  Also disable automatic
         schema migration attempt. Users are required to manully migrate schema after Hive upgrade which ensures
         proper metastore schema migration. (Default)
   False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.
   </description>
</property>
复制代码


再次运行:

hive> show tables;
OK
Time taken: 7.651 seconds
hive> 

继续执行hive命令

>hive create table tb( id int, name string); 
14/11/25 18:22:18 ERROR exec.DDLTask: java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B

解决办法:(参考:http://conkeyn.iteye.com/blog/2010818, http://blog.csdn.net/slx_2011/article/details/24770217)

hive和hadoop目录下lib中libthrift-x.x.x.jar 版本不一致导致的,将hive/lib/libthrift-0.9.0.jar 拷贝到 hadoop/lib/目录下,删除原 libthrift-0.8.0.jar

 

PS:

hadoop版本:hadoop-1.1.2

hive版本:hive-0.12.0

hbase版本:hbase-0.94.20

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值