hive启动报错

1. hive启动时,报错
Caused by: java.net.NoRouteToHostException: No Route to Host from  slave1/192.168.56.102 to master:9000 failed on socket timeout 
exception: java.net.NoRouteToHostException: 没有到主机的路由; For more details see:  http://wiki.apache.org/hadoop/NoRouteToHost

其原因是master无法穿透slaver的防火墙,只需要关闭所有主机的防火墙即可。命令如下
systemctl  stop  firewalld

2. 重新启动hadoop
停止hadoop 
[grid@master sbin]$ stop-all.sh
WARNING: Stopping all Apache Hadoop daemons as grid in 10 seconds.
WARNING: Use CTRL-C to abort.
Stopping namenodes on [master]
Stopping datanodes
Stopping secondary namenodes [master]
Stopping nodemanagers
Stopping resourcemanager
[grid@master sbin]$ pwd
/home/grid/hadoop-3.2.0/sbin


3. 重启hive,接下来报如下错误
Logging initialized using configuration in jar:file:/home/grid/apache-hive-3.1.1-bin/lib/hive-common-3.1.1.jar!/hive-log4j2.properties Async: true
Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException: Call From slave1/192.168.56.102 to master:
9000 failed on connection exception: java.net.ConnectException: 
拒绝连接; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

原因,没有启动hadoop
在master上启动hadoop
[grid@master sbin]$ pwd
/home/grid/hadoop-3.2.0/sbin
[grid@master sbin]$ start-dfs.sh
Starting namenodes on [master]
Starting datanodes
Starting secondary namenodes [master]
[grid@master sbin]$ start-yarn.sh
Starting resourcemanager
Starting nodemanagers
4. 在slave1上kill掉hive的服务后重启,又报错
[grid@slave1 bin]$ jps
31988 Jps
31579 RunJar
31710 RunJar
[grid@slave1 bin]$ kill -9 31579
[grid@slave1 bin]$ kill -9 31710
[1]-  已杀死               nohup hive --service metastore >> ~/metastore.log 2>&1
[grid@slave1 bin]$ jps
31998 Jps
[2]+  已杀死               nohup hive --service hiveserver2 >> ~/hiveserver2.log 2>&1
[grid@slave1 bin]$ nohup hive --service metastore >> ~/metastore.log 2>&1 &       
[1] 32008
[grid@slave1 bin]$  nohup  hive --service hiveserver2 >> ~/hiveserver2.log 2>&1 & 
[2] 32141
[grid@slave1 bin]$ hive
which: no hbase in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/grid/jdk1.8.0_201/bin:/home/grid/hadoop-3.2.0/bin:/home/grid/hadoop-3.2.0/sbin:/home/grid/hadoop-3.2.0/lib:/usr/local/mysql/bin:/home/grid/hive/bin:/home/grid/.local/bin:/home/grid/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/grid/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/grid/hadoop-3.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
Hive Session ID = 7c15c311-02a7-4a1f-8125-89f15ce4d75a

Logging initialized using configuration in jar:file:/home/grid/apache-hive-3.1.1-bin/lib/hive-common-3.1.1.jar!/hive-log4j2.properties Async: true
Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
原因,配置文件没有配置临时文件路径绝对地址
修改hive-site.xml的环境变量
${system:java.io.tmpdir}=/home/grid/hive/tmp
${system:user.name}=grid

5.重新启动hive,启动成功如下:
[grid@slave1 bin]$ hive
which: no hbase in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/grid/jdk1.8.0_201/bin:/home/grid/hadoop-3.2.0/bin:/home/grid/hadoop-3.2.0/sbin:/home/grid/hadoop-3.2.0/lib:/usr/local/mysql/bin:/home/grid/hive/bin:/home/grid/.local/bin:/home/grid/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/grid/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/grid/hadoop-3.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
Hive Session ID = 601f1d05-59a2-4b78-852e-974c6916c77b

Logging initialized using configuration in jar:file:/home/grid/apache-hive-3.1.1-bin/lib/hive-common-3.1.1.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Hive Session ID = fded1d58-8b4c-4de8-b959-372e1433ab8d
hive (default)> 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值