记hbase list 命令报错zookeeper连接失败

hbase list 命令报错:zookeeper exists failed after 4 attempts

$telnet h0082161 2181

Connected to 172.16.82.161.
Escape character is '^]'.

telnet connect by close foreign.
此时发现telnet h0082161 其他端口均正常,其他机器telnet h0082161 2181正常,
此时进入一个误区,一直在围绕telnet 服务查看,查看/etc/xinted.conf,无异常,启动xinted服务依旧失败。防火墙全部关闭,依旧失败
 
理性分析可知,zookeeper 服务正常,本机telnet 服务也正常。
 
此时查看hmaster 中zookeeper(tail -f /usr/server/hbase/logs/hbase-hadoop-zookeeper-h0082161.log)日志,惊喜出现:
 
 
日志显示来自该机器的zookeeper 连接数超过限制300!
查看该机器zookeeper 连接数,netstat -anltp |grep 161:2181 |wc -l  果真大于300,查看连接均来自jobserver ,
解决:重启jobserver 释放连接后, hbase shell 使用恢复正常。
 
教训:
  排查端口连接问题,不能仅使用telnet 命令来断定不通
  注意查找日志。通常会发现惊喜,从应用程序找原因,网络连接不仅限系统原因。
  
 
原文地址:https://www.cnblogs.com/hello-kelly/p/4808210.html