hive里 只能进去不能输命令,一输就报错
HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
初始化很多遍后:
# 初始化之前最好把之前的数据库删除掉
rm -rf derby.log metastore_db/
# 初始化
bin/schematool -dbType derby -initSchema
重装。
重装又报错,初始化报错:
[root@node7-4 apache-hive]# bin/schematool -dbType mysql -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/data/hive/apache-hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/data/hadoop/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL: jdbc:mysql://192.168.56.1:3306/hive-demo?useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
Metastore Connection Driver : com.mysql.cj.jdbc.Driver
Metastore connection User: root
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: com.mysql.cj.jdbc.exceptions.CommunicationsException : Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
SQL Error code: 0
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
表进不去
解决方法:我的linux上的mysql版本是5.1,spark,hive和mysql的版本冲突了,这个时候重装mysql
我的mysql版本是8.0.21,就可以了
hive版本:apache-hive-3.1.2-bin, spark版本:spark-2.2.1-bin-hadoop2.7
https://www.cnblogs.com/lemon-feng/p/11233227.html