赞
踩
下载hive:https://downloads.apache.org/hive/
安装及配置hive:hive:https://blog.csdn.net/qq_28854219/article/details/81185610?
错误一
[root@node01 conf]# hive
19/03/31 09:57:31 WARN conf.HiveConf: HiveConf of name hive.metastore.local does not exist
Logging initialized using configuration in jar:file:/opt/sxt/apache-hive-1.2.2-bin/lib/hive-common-1.2.2.jar!/hive-log4j.properties
Exception in thread “main” java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient…
可能原因: 没有mysql和hive没有连接上
解决办法: 将mysql-connector-java-5.1.32-bin.jar拷贝一份到hive的lib目录下。
(下载jar包:https://dev.mysql.com/downloads/connector/j/
)
错误二
Terminal initialization failed; falling back to unsupported
可能原因: 这是由于hadoop的目录中存在老版本的jline-0.9.94.jar
解决办法: 将hive下的新版本jline的JAR包拷贝到hadoop下 cp /hive/apache-hive-1.1.0-bin/lib/jline-2.12.jar /hadoop-2.5.2/share/hadoop/yarn/lib/
并删除老版本:jline-0.9.94.jar
错误三
hive.site.xml配置文件出错
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hive.server2.thrift.bind.host</name> <value>hadoop1</value> <description>Bind host on which to run the HiveServer2 Thrift service.</description> </property> <property> <name>datanucleus.fixedDatastore</name> <value>false</value> </property> <property> <name>hive.metastore.execute.setugi</name> <value>true</value> </property> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.223.10:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>admin</value> </property> <property> <name>hive.metastore.warehouse.dir</name> <value>/usr/hive/apache-hive-1.2.2-bin/warehouse</value> </property> <property> <name>hive.exec.scratchdir</name> <value>/usr/hive/apache-hive-1.2.2-bin/tmp</value> </property> <property> <name>hive.querylog.location</name> <value>/usr/hive/apache-hive-1.2.2-bin/log</value> </property> <property> <name>hive.metastore.schema.verification</name> <value>false</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>hadoop1:2181,hadoop2:2181,hadoop3:2181</value> </property> </configuration>
主要修改其中的
jdbc:mysql://master:3306/hive?createDatabaseIfNotExist=true&useSSL=false
将master改为对应的主机ip如:
jdbc:mysql://192.168.223.10:3306/hive?createDatabaseIfNotExist=true&useSSL=false
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。