文章目录
- 异常情况描述
- 解决方案
异常情况描述
1)在hdp-04上启动hiveserver2:
[root@hdp-04 bin]# hiveserver2
which: no hbase in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/doc/hadoop-3.3.0/sbin:/root/doc/hadoop-3.3.0/bin:/root/doc/zookeeper-3.4.6/bin:/root/doc/hive-3.1.2/bin:/usr/local/java/jdk/jdk1.8.0_231/bin:/root/bin)
2020-07-31 06:11:44: Starting HiveServer2
Hive Session ID = b1737575-0ef3-46bb-a06c-cc8c36dc0fc3
Hive Session ID = 448db6f3-1594-4630-b030-8520721d1705
Hive Session ID = f7013865-c671-481c-ac50-ac8abf33cb63
Hive Session ID = 44d77278-9b22-4e86-b1db-1846df3255ad
2)netstat -nltp查看看端口10000,则代表已经启动成功
[root@hdp-04 hadoop]# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2118/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1892/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2263/master
tcp 0 0 ::ffff:192.168.139.14:8033 ::???? LISTEN 2615/java
tcp 0 0 :::10000 ::???? LISTEN 4598/java
tcp 0 0 :::10002 ::???? LISTEN 4598/java
tcp 0 0 :::22 ::???? LISTEN 2118/sshd
tcp 0 0 ::1:631 ::???? LISTEN 1892/cupsd
tcp 0 0 ::ffff:192.168.139.14:8088 ::???? LISTEN 2615/java
tcp 0 0 ::1:25 ::???? LISTEN 2263/master
3)在hdp-05上启动beeline,连接 报错
beeline> !connect jdbc:hive2://hdp-04:10000
Connecting to jdbc:hive2://hdp-04:10000
Enter username for jdbc:hive2://hdp-04:10000: root
Enter password for jdbc:hive2://hdp-04:10000:
20/07/31 06:04:25 [main]: WARN : Failed to connect to hdp-04:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://hdp-04:10000: Failed to open new session: : org.apache.(): User: root is not allowed to impersonate root (state=08S01,code=0)
解决方案
在hadoop 的 配置中增加如下配置:
<property>
<name></name>
<value>*</value>
</property>
<property>
<name></name>
<value>*</value>
</property>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
注意: 此处需要使用root.
将配置文件拷贝到所有集群, 重启hadoop, 再重新启动hiveserver2 和beeline 即可