在使用Hive的过程中,是不是会在shell中报一堆警告,虽然说不影响正常使用,但是看着很烦人,而且指不定会影响数据的准确性和运行的稳定性。
警告的内容如下:
Tue Aug :: CST 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.
产生报警的原因是因为,我搭建的Hive使用MySql作为metadata的存储,而MySql为5.7.12版本,需要在连接串中指定是否采用SSL连接。
所以我们只需修改Hive的 hive-site.xml,在连接串中加入指定SSL为false即可:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://ut07:3306/hive?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false</value>
</property>