Hive启动常见报错及解决办法:[Exceptioninthread“main“java.。。。Hive启动常见报错及解决办法:[Exception in thread “main” java.lang.RuntimeException: org.apache.hadoop.adata.HiveException: java.lang.RuntimeException: Unable to instantiate
报错内容:
[Exception in thread “main” java.lang.RuntimeException: org.apache.hadoop.adata.HiveException:
java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.adata.SessionHiveMetaStoreClient
Caused by: org.apache.hadoop.adata.HiveException: java.lang.RuntimeException: Unable to instantiate
org.apache.hadoop.adata.SessionHiveMetaStoreClient
Caused by: java.lang.RuntimeException: Unable to instantiate
org.apache.hadoop.adata.SessionHiveMetaStoreClient
Caused by: flect.InvocationTargetException
Caused by: MetaException(message:Could not connect to meta store using any of the URIs provided. Most recent failure: org.ansport.TTransportException: java.ConnectException: 拒绝连接 (Connection refused)
Caused by: java.ConnectException: 拒绝连接 (Connection refused)]
原因1:未启动metastore服务:
解决办法:
cd %HIVE_HOME%\bin
并输⼊:
hive --service metastore &
bin/hive
原因2:未初始化数据库:
解决办法:
cd %HIVE_HOME%\bin
并输⼊:
schematool -dbType mysql -initSchema
如果初始化失败,输出mysql -uroot -p123456进⼊mysql操作界⾯,删除hive数据库,再次尝试.
thrift原因3:未正确配置%HIVE_HOME%\l
具体看注释:
<configuration>
<!-- 存储元数据mysql相关配置,其中地址要填写你本地ip,端⼝号默认为3306 -->
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.88.101:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value> </property>
<property>
<!-- 此处为固定格式 -->
<name>javax.jdo.option.ConnectionDriverName</name>
<value&sql.cj.jdbc.Driver</value>
</property>
<property>
<!-- 此处为固定格式,"root"请修改为你当前mysql的⽤户名 -->
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<!-- 此处为固定格式,"123456"请修改为你当前mysql的密码 -->
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
<!-- H2S运⾏绑定host,hadoop101为你当前节点的hostname,如未配置,则填写当前节点ip地址 -->
<property>
<name>hive.server2.thrift.bind.host</name>
<value>hadoop101</value>
</property>
<!-- 远程模式部署metastore metastore地址,修改ip地址 -->
<property>
<name&astore.uris</name>
<value>thrift://192.168.88.101:9083</value>
</property>
<!-- 关闭元数据存储授权--固定格式 -->
<property>
<name&astore.ification.api.auth</name>
<value>false</value>
</property>
<!-- 关闭元数据存储版本的验证--固定格式 -->
<property>
<name&astore.schema.verification</name>
<value>false</value>
</property>
</configuration>
原因4:未正确配置%HIVE_HOME%\conf\hive-env.sh
解决⽅法:
vim %HIVE_HOME%\conf\hive-env.sh
在末尾加上这三⾏
export HADOOP_HOME=/export/servers/hadoop-2.7.5
export HIVE_CONF_DIR=/export/servers/hive/conf
export HIVE_AUX_JARS_PATH=/export/servers/hive/lib

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。