启动hive hiveserver2会报警告-Mon Oct 16 10:25:12 CST 2017 WARN: Establishing SSL connection without server

原创 2017年10月16日 17:35:29

启动hive hiveserver2会报警告,如下所示警告信息,那该怎么解决呢?

Mon Oct 16 10:25:12 CST 2017 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.

解决过程中又遇到如下错的,该怎么解决呢?

[Fatal Error] hive-site.xml:554:80: The reference to entity "useSSL" must end with the ';' delimiter.Exception in thread "main" java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/Users/a6/Applications/apache-hive-2.3.0-bin/conf/hive-site.xml; lineNumber: 554; columnNumber: 80; The reference to entity "useSSL" must end with the ';' delimiter.

下面将从发现问题,解决问题,总结经验这几个方面来介绍:

(1) 启动hive hiveserver2会报警告,如下所示警告信息:
localhost:bin a6$ hive --service hiveserver2 &
[1] 2135
localhost:bin a6$ 2017-10-16 10:25:05: Starting HiveServer2
localhost:bin a6$ SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/a6/Applications/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/a6/Applications/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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]
Mon Oct 16 10:25:12 CST 2017 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.
Mon Oct 16 10:25:12 CST 2017 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.

(2)根据提示和百度,需要在jdbc连接字符串中使用useSSL=true或者useSSL=false

第一次修改如下所示:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive_meta_db?characterEncoding=utf8&useSSL=true&createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
或者
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive_meta_db?characterEncoding=utf8;useSSL=true;createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>

(3)修改配置后jdbc连接字符后,需要执行初始化命令,却都报了如下错误:
localhost:bin a6$ schematool -dbType mysql -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/a6/Applications/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/a6/Applications/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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]
[Fatal Error] hive-site.xml:554:80: The reference to entity "useSSL" must end with the ';' delimiter.
Exception in thread "main" java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/Users/a6/Applications/apache-hive-2.3.0-bin/conf/hive-site.xml; lineNumber: 554; columnNumber: 80; The reference to entity "useSSL" must end with the ';' delimiter.
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2597)
    at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2454)
    at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2361)
    at org.apache.hadoop.conf.Configuration.get(Configuration.java:1188)
    at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:3901)
    at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:3970)
    at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:4057)
    at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:4005)
    at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:82)
    at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: org.xml.sax.SAXParseException; systemId: file:/Users/a6/Applications/apache-hive-2.3.0-bin/conf/hive-site.xml; lineNumber: 5
(4) 给出原因和解决方案

几番查找,终于找到症结:连接jdbc时,路径连接参数之前一直是使用 & 符号连接,但是这次却提示用 ; 来进行连接,于是 按照编译器的提示 我把 & 改为;,于是 运行起来它把两个参数 当做了一个参数,OhMyGod!在没头没脑的一番探索后,终于发现问题,在xml文件中 &符号 需要转义 这个根据 HTML 的转义规则 更改就行& -> &amp; 于是便成功解决了。

正确代码如下:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive_meta_db?characterEncoding=utf8&useSSL=true&createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
1) 再次执行初始化hive的元数据库命令
localhost:bin a6$ pwd
/Users/a6/Applications/apache-hive-2.3.0-bin/bin
localhost:bin a6$
localhost:bin a6$ schematool -dbType mysql -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/a6/Applications/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/a6/Applications/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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://localhost:3306/hive_meta_db?characterEncoding=utf8&useSSL=true&createDatabaseIfNotExist=true
Metastore Connection Driver :     com.mysql.jdbc.Driver
Metastore connection User:     hive_user
Starting metastore schema initialization to 2.3.0
Initialization script hive-schema-2.3.0.mysql.sql
Initialization script completed
schemaTool completed
localhost:bin a6$
2) 查看初始化后的信息: schematool -dbType derby -info
localhost:bin a6$ schematool -dbType derby -info
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/a6/Applications/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/a6/Applications/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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://localhost:3306/hive_meta_db?characterEncoding=utf8&useSSL=true&createDatabaseIfNotExist=true
Metastore Connection Driver :     com.mysql.jdbc.Driver
Metastore connection User:     hive_user
Hive distribution version:     2.3.0
Metastore schema version:     2.3.0
schemaTool completed
localhost:bin a6$
3) 之后再次启动hiveserver2服务,则发现不会报警告信息啦
localhost:bin a6$ hive --service hiveserver2 &
[1] 4722
localhost:bin a6$ 2017-10-16 16:58:31: Starting HiveServer2
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/a6/Applications/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/a6/Applications/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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]
4) 使用jps,可以查看hiveserver2服务,顺利启动啦。
localhost:bin a6$ jps
4909 Jps
4722 RunJar
localhost:bin a6$

(5)其他介绍

1)如果是第一次需要执行初始化命令:schematool -dbType mysql -initSchema
    以Mysql数据库为例:创建好用户:hive_user;database:test_hivedb。Remote方式需要分别配置服务端和客户端的配置文件:
服务端的 hive-site.xml 中jdbc URL、驱动、用户名、密码等属性值配置。
如果是第一次需要执行初始化命令:schematool -dbType mysql -initSchema
2)hive metastore 服务端启动命令:
hive --service metastore -p <port_num>
如果不加端口默认启动:hive --service metastore,则默认监听端口是:9083 ,注意客户端中的端口配置需要和启动监听的端口一致。服务端启动正常后,客户端就可以执行hive操作了。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/helloxiaozhe/article/details/78252135

CST 2016 WARN: Establishing SSL connection without server‘s identity verification is not recommended

Success loading Mysql Driver! Mon Apr 04 15:43:00 CST 2016 WARN: Establishing SSL connection without...
  • yang5726685
  • yang5726685
  • 2017-10-26 11:29:08
  • 487

Establishing SSL

Tue May 16 09:08:59 CST 2017 WARN: Establishing SSL connection without server's identity verificatio...
  • cocoaxian
  • cocoaxian
  • 2017-05-16 09:20:39
  • 2573

Mysql报警告:WARN: Establishing SSL connection

Mysql报警告:WARN: Establishing SSL connection 警告信息
  • wangxilong1991
  • wangxilong1991
  • 2016-12-08 10:48:11
  • 3311

WARN: Establishing SSL connection

作者:叁念 WARN: Establishing SSL connection在我们使用连接MySQL数据库时会出现这样的提示:...
  • qq_36868342
  • qq_36868342
  • 2017-08-29 13:37:35
  • 5665

MySQL 警告WARN: Establishing SSL connection without server's identity verification is not recommended.

Mon Apr 04 15:43:00 CST 2016 WARN: Establishing SSL connection without server‘s identity verificatio...
  • Dillon2015
  • Dillon2015
  • 2016-11-14 12:58:29
  • 5102

Fri Jul 28 16:19:08 CST 2017 WARN: Establishing SSL connection without server's identity verificati

如下:Fri Jul 28 16:28:52 CST 2017 WARN: Establishing SSL connection without server’s identity verifica...
  • u012123511
  • u012123511
  • 2017-07-28 16:32:00
  • 5959

Java 连接mysql数据库warn:Establishing SSL connection without server's identity verification is not ...

连接数据库时运行成功,查询结果也有,但是控制台却报出警告。警告信息如下:Fri Jul 21 13:55:07 CST 2017 WARN: Establishing SSL connection w...
  • Wynford
  • Wynford
  • 2017-07-21 14:09:09
  • 970

IDEA+MYSQL 运行报错:WARN: Establishing SSL connection

执行获取数据库数据操作控制台抛出以下错误:Wed Mar 21 09:28:33 CST 2018 WARN: Establishing SSL connection without server's...
  • wq1039822486
  • wq1039822486
  • 2018-03-21 16:20:02
  • 288

警告: Establishing SSL connection without server

问题描述: WARN: Establishing SSL connection without server's identity verification is not recommended. ...
  • kbf_hwang
  • kbf_hwang
  • 2017-05-10 15:05:37
  • 411

Hive提示警告SSL

一、问题Hive能正常执行任务,但出现“WARN: Establishing SSL connection without server’s identity verification is not ...
  • u012922838
  • u012922838
  • 2017-06-15 16:00:26
  • 2021
收藏助手
不良信息举报
您举报文章:启动hive hiveserver2会报警告-Mon Oct 16 10:25:12 CST 2017 WARN: Establishing SSL connection without server
举报原因:
原因补充:

(最多只允许输入30个字)