当前位置:   article > 正文

安装hive出现的各种问题_hive> show tables; failed: semanticexception org.a

hive> show tables; failed: semanticexception org.apache.hadoop.hive.ql.metad

进入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;
  • 1
  • 2

(注:要执行./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>
  • 1
  • 2
  • 3
  • 4

再执行命令:

schematool -dbType mysql -initSchema
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/605868
推荐阅读
相关标签
  

闽ICP备14008679号