how-to: resolve "Connection refused" during connext hiveserver2 via beeline

Issue:
At hiveserver2 node, could connect hiveserver2 via localhost/127.0.0.1, but connection refused when using ip.
At other node, could not access hiveserver2 via ip
Connect command is like:
/opt/hive/bin/beeline -ujdbc:hive2://hostname:10000/datacenter_huke_firstp2p -nhadoop -phadoop

How-to-trace issue:
  • netstat -nltp | grep 10000
    tcp        0      0 127.0.0.1:10000               0.0.0.0:*                   LISTEN      5810/java
    which means,  just port 10000 is binded with 127.0.0.1. Just 127.0.0.1 and localhost could access this port. Here is the setting in /etc/hosts:
    127.0.0.1   localhost
  • In hive-site.xml file, check hive.server2.thrift.bind.host
    <property>
      <name>hive.server2.thrift.bind.host</name>
      <value>localhost</value>
      <description>Bind host on which to run the HiveServer2 Thrift interface.
      Can be overridden by setting $HIVE_SERVER2_THRIFT_BIND_HOST</description>
    </property>
    That is the point, the value should be 0.0.0.0, which means every ip style could access this port.(including ip, hostname, 127.0.0.1, localhost)
  • After setting this property to "0.0.0.0". Hiveserver2 could be connected now. 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值