IT源码网

安装hive出现的各种问题

xmjava 2021年11月03日 大数据 364 0

进入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

评论关闭
IT源码网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

mysql:sql_mode=“only_full_group_by”