启动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操作了。

版权声明:本文为博主原创文章,未经博主允许不得转载。

用eclipse配置hibernate的hbm.xml文件时遇到的一些问题

  • albertjone
  • albertjone
  • 2017年01月11日 13:49
  • 1424

使用SpringBoot编写Restful风格接口

一、简介 Restful是一种对url进行规范的编码风格,通常一个网址对应一个资源,访问形式类似http://xxx.com/xx/{id}/{id}。举个栗子,当我们在某购物网站上买手机时会有很多品...
  • forMelo
  • forMelo
  • 2018年01月09日 20:17
  • 21

Hive提示警告SSL

一、问题Hive能正常执行任务,但出现“WARN: Establishing SSL connection without server’s identity verification is not ...
  • u012922838
  • u012922838
  • 2017年06月15日 16:00
  • 1478

SSM开发--利用MyBatis Generator自动创建代码

准备工作: 下载mybatis的jar包,最新版本:https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.4.1 另外准备mysql-...
  • wuxidemo
  • wuxidemo
  • 2016年10月05日 08:20
  • 190

Hive学习之HiveServer2服务端配置与启动

在之前的学习和实践Hive中,使用的都是CLI或者hive –e的方式,该方式仅允许使用HiveQL执行查询、更新等操作,并且该方式比较笨拙单一。幸好Hive提供了轻客户端的实现,通过HiveServ...
  • sky_walker85
  • sky_walker85
  • 2014年08月01日 13:49
  • 32608

Hive的内置服务和hiveserver/hiveserver2的比较

两者都允许远程客户端使用多种编程语言,通过HiveServer或者HiveServer2,客户端可以在不启动CLI的情况下对Hive中的数据进行操作,连这个和都允许远程客户端使用多种编程语言如java...
  • Gamer_gyt
  • Gamer_gyt
  • 2016年08月01日 19:01
  • 17178

Hive学习之HiveServer2服务端配置与启动

在之前的学习和实践Hive中,使用的都是CLI或者hive –e的方式,该方式仅允许使用HiveQL执行查询、更新等操作,并且该方式比较笨拙单一。幸好Hive提供了轻客户端的实现,通过HiveServ...
  • vfgbv
  • vfgbv
  • 2016年03月30日 11:20
  • 2683

Hive学习之HiveServer2服务端配置与启动,允许远程连接

hive.metastore.warehouse.dir /usr/hive/warehouse //(hive中的数据库和表在HDFS中存放的文件夹的位置) lo...
  • u013310119
  • u013310119
  • 2017年11月09日 09:38
  • 188

【Hadoop】hiveserver2 不能启动端口 10000 开启服务的相关经验总结

这个问题困扰了我三天,各种查资料踩坑填坑的尝试,终于搞定了不能链接hive2的这个问题。...
  • lsttoy
  • lsttoy
  • 2016年12月06日 17:41
  • 7963

使用新版本mysql-connector-java异常解决

最近按正常的方法搭建SSM框架,无法正常启动Tomcat出现如下异常信息:   com.mysql.cj.core.exceptions.InvalidConnectionAttributeExcep...
  • qq_34871626
  • qq_34871626
  • 2017年12月06日 22:09
  • 87
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:启动hive hiveserver2会报警告-Mon Oct 16 10:25:12 CST 2017 WARN: Establishing SSL connection without server
举报原因:
原因补充:

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