安装hive出现的各种问题

进入hive 执行show databases时报错, 错误如下:

hive FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

利用/usr/local/Cellar/hive/2.3.1/libexec/bin目录下的hive进入hive,再执行show databases查看日志:

./hive -hiveconf hive.root.logger=DEBUG,console
show databases;

(注:要执行./hiveserver2后再执行该命令)

报如下错误:

The specified datastore driver (“com.mysql.jdbc.Driver”) was not found in the CLASSPATH.

解决办法:把mysql-connector-java-5.1.42.jar包放入libexec/lib目录下。但解决完这个问题后仍然报错,错误如下:

2017-12-05T11:52:50,446 WARN [ecd471e5-d4b9-40b4-bc9a-644fc411f415 main] metastore.MetaStoreDirectSql: Self-test query [select “DB_ID” from “DBS”] failed; direct SQL is disabled
javax.jdo.JDODataStoreException: Error executing SQL query “select “DB_ID” from “DBS”“.
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:543) ~[datanucleus-api-jdo-4.2.4.jar:?]
……
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘hive.dbs’ doesn’t exist
……
2017-12-05T11:52:50,457 ERROR [ecd471e5-d4b9-40b4-bc9a-644fc411f415 main] metastore.RetryingHMSHandler: MetaException(message:Version information not found in metastore. )

原因:没生成源数据表,打开hive-site.xml,设置如下为true

 <property>
    <name>datanucleus.schema.autoCreateAll</name>
    <value>true</value>
  </property>

再执行命令:

schematool -dbType mysql -initSchema
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值