异常一
com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/
com.google.common.base.Preconditions.checkArgument对应的是guava-jre-jar
也就是提示我们 HIVE_HOME/lib 下的guava-xx.xx.xx-jre-jar与Hadoop不匹配
所以去HADOOP_HOME/share/hadoop/common/lib 目录下拷贝一份过来
楼主的命令是这样的
cp /usr/local/hadoop/hadoop-3.1.3/share/hadoop/common/lib/guava-27.0-jre.jar ./
异常二
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version
Caused by: java.sql.SQLException: null, message from server: “Host ‘hadoop51’ is not allowed to connect to this MySQL server”
Underlying cause: java.sql.SQLException : null, message from server: “Host ‘hadoop51’ is not allowed to connect to this MySQL server”
SQL Error code: 1130
首先需要在配置文件中增加转义符
createDatabaseIfNotExist=true&useSSL=false
<property>
<!-- mysql数据库的URL -->
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.0.51:3306/metastore?createDatabaseIfNotExist=true&useSSL=false</value>
</property>
然后登录mysql数据库
mysql -uroot -ppasswd
使用mysql库
mysql>use mysql;
查看用户
mysql>select User, Host from user;
增加权限(可以这么理解)
mysql>update user set host=’%’ where host=‘localhost’;
刷新
mysql>flush privileges;