挨个检查
1.环境变量
vi /etc/profile.d/my_env.sh
export HIVE_HOME=/home/zheng/softwarre/hive
export HCATALOG_HOME=/home/zheng/software/hive/hcatalog
export PATH=$PATH:$HIVE_HOME/bin:$HCATALOG_HOME/bin:$HCATALOG_HOME/sbin
//注意是否刷新 source /etc/profile
2. hive.site.xml文件
<property> <name>hive.querylog.location</name> <value>/home/zheng/sofeware/hive/log</value> <description>Location of Hive run time structured log file</description> </property> <property> <name>hive.exec.local.scratchdir</name> <value>/home/zheng/software/hive/local</value> <description>Local scratch space for Hive jobs</description> </property> <property> <name>hive.downloaded.resources.dir</name> <value>/home/zheng/software/hive/resources</value> <description>Temporary local directory for added resources in the remote filesystem.</description> </property><property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.30.128:3306/hive?useUnicode=true&createDatabaseIfNotExist=true&characterEncoding=UTF8&useSSL=false&serverTimeZone=GMT</value> </property> <!-- jdbc mysql驱动 --> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.cj.jdbc.Driver</value> </property> <!-- mysql的用户名和密码 --> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>131127xx</value> </property> <!-- 日志目录 --> <property> <name>hive.querylog.location</name> <value>/home/zheng/software/hive/log</value> </property> <!-- 设置metastore的节点信息 --> <property> <name>hive.metastore.uris</name> <value>thrift://192.168.30.128:9083</value> </property>
//注意路径问题
//hive-site.xml配置文件中,3215行有特殊字符“ ”,需要将此特殊符号删除掉
** 3.hive/lib目录下是否有mysql驱动包**
链接:https://pan.baidu.com/s/1oK7pJkduLoRQRW4QCZpqBA
提取码:1234
删除hive/lib目录下原有的 protobuf-java-2.5.0.jar 文件
将其换为: protobuf-java-3.5.1.jar
删除 hive/lib目录下原有 guava-19.0.jar
将其换位hadoop下的guava-27.0-jre.jar rm -r guava-19.0.jar
我因为环境变量拼写错误导致无法初始化hive
版权归原作者 Python奴隶 所有, 如有侵权,请联系我们删除。