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.
下面将从发现问题,解决问题,总结经验这几个方面来介绍:
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.
javax.jdo.option.ConnectionURL
jdbc:mysql://localhost:3306/hive_meta_db?characterEncoding=utf8&useSSL=true&createDatabaseIfNotExist=true
JDBC connect string for a JDBC metastore
或者
javax.jdo.option.ConnectionURL
jdbc:mysql://localhost:3306/hive_meta_db?characterEncoding=utf8;useSSL=true;createDatabaseIfNotExist=true
JDBC connect string for a JDBC metastore
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.(HiveConf.java:4005)
at org.apache.hive.beeline.HiveSchemaTool.(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) 给出原因和解决方案
javax.jdo.option.ConnectionURL
jdbc:mysql://localhost:3306/hive_meta_db?characterEncoding=utf8&useSSL=true&createDatabaseIfNotExist=true
JDBC connect string for a JDBC metastore
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$