8月19日 hive的再配置

今天继续配置hive

之前的show databases 会一直抱错

Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

在继续解决的时候,发现我自己写的hive-site.xml文件里面的链接地址不正确,将自己的ip地址放入

同时按照网上的资料在bin 目录下输入hive --service metastore &

报错,显示在hive-site.xml文件中地址那一行的值错误,经过我多次尝试见过多种多样报错后,

我发现了这一条规则:

Xml文件中不能使用&,要使用他的转义&来代替

于是我想着 hive-site.xml文件没问题了,然后报了这个错

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.

这个需要在hive-site.xml文件中添加一个属性useSSL=false

在多次运行这条命令多次报错后,我的hive-site.xml文件最终成型

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.0.102:3306/hive?createDatabaseIfNotExsit=true&amp;useSSL=false&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC </value>

</property>

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>datanucleus.schema.autoCreateAll</name>
<value>true</value>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
</configuration>

之后建议将自己Java用的mysql的链接jar包放在hive的lib目录下,经过一系列的操作,这次showdatabases;成功了。

不过在bin 目录下输入hive --service metastore & 仍会报错

tried to access method com.google.common.base.Stopwatch.<init>()V from class org.apache.hadoop.ma...

这样的错误我没有找到合适的解决。

学习时间:11:35 到14:02

原文地址:https://www.cnblogs.com/buyaoya-pingdao/p/15161453.html