实验中遇到的问题
- 实验过程中hive打不开
java.lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument
原因是hive安装目录下lib内guava.jar和hadoop安装目录下share/hadoop/common/lib内guava.jar版本不一样。解决方法是删除低版本的,并拷贝高版本的。
2.启动hive时报错:Tue Oct 19 16:41:49 CST 2021 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
根据告警提示有两种解决方法:
(1)设置useSSL=false
这里有个坑就是hive的配置文件是.XML格式,而在xml文件中&;才表示&,所以正确的做法是在Hive的配置文件中,如hive-site.xml进行如下设置
(2)设置useSSL = true并为服务器证书验证提供信任库。
(3)hive里面建表时报错,无法实现实例化
FAILED: HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHivemetaStoreClient
原因分析:是由于没有初始化数据库导致,执行名称初始化数据库即可。
解决办法:
执行命令:schematool -dbType mysql -initSchema
但是执行改命令进行初始化又出现如下错误:
Underlying cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException : Communications link failure (根本原因是通信链路故障)
百度了一下方法有
(1)修改一下wait_timeout的参数值,并修改mysql配置文件:vim /etc/my.cnf
链接:
(6条消息) Underlying cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException : Communications link fail_小丽-CSDN博客
没有用
(2)也有说是mysql的时区问题
打开/usr/local/hive/conf/hive-site.xml
hive配置文件hive-site.xml中ConnectionURL中加上serverTimezone=GMT
链接:
(6条消息) 错误:org.apache.hadoop.hive.metastore.HivemetaException: Failed to get schema version_葉蕖的博客-CSDN博客
其中createDatabaseIfNotExist=true,useSSL=false,否则还是会出错
实验中有个错误是xml version=”0.0”应该修改为1.0
之前的错误是
Underlying cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException : Communications link failure
The last packet successfully received from the server was 631 milliseconds ago. The last packet sent successfully to the server was 620 milliseconds ago.
SQL Error code: 0
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
现在的错误变为org.apache.hadoop.hive.metastore.HivemetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : Access denied for user 'hive'@'localhost' (using password: YES)
SQL Error code: 1045
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
搜索了出现的问题,说是hive密码设置错误。
(6条消息) Underlying cause: java.sql.SQLException : Access denied for user 'root'@'s150' (using password: YES)_Joy-CSDN博客
试着修改了一下,之后再进行初始化就成功了!!!!



