#描述:
启动 start-hbase.sh 或者 JAVA 代码连接hbase时会出现 SASL 问题
# 错误信息:
WARN org.apache.zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
WARN org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
2013-11-12 23:28:31,676 INFO org.apache.hadoop.hbase.util.RetryCounter: Sleeping 8000ms before retry #3...
2013-11-12 23:28:31,676 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server slave002/172.25.60.202:2181. Will not attempt to authenticate using SASL (无法定位登录配置)
#可能的改正,已验证:
1. 注意 分隔符 ///
hbase-site.xml 中的 hbase.rootdir 配置 :
<property>
<name>hbase.rootdir</name>
<value>file:///D:/data/HbaseData</value>
</property>
启动 start-hbase.sh 或者 JAVA 代码连接hbase时会出现 SASL 问题
# 错误信息:
WARN org.apache.zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
WARN org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
2013-11-12 23:28:31,676 INFO org.apache.hadoop.hbase.util.RetryCounter: Sleeping 8000ms before retry #3...
2013-11-12 23:28:31,676 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server slave002/172.25.60.202:2181. Will not attempt to authenticate using SASL (无法定位登录配置)
#可能原因:
1. hbase的用的ip地址,而zookeeper(含内置的)解析后只返回 域名 ,缺乏一个DNS机制
详见 http://www.iteye.com/topic/1132950
2. hbase的data文件的地址写错
#可能的改正,已验证:
1. 注意 分隔符 ///
hbase-site.xml 中的 hbase.rootdir 配置 :
<property>
<name>hbase.rootdir</name>
<value>file:///D:/data/HbaseData</value>
</property>
2. 域名修改
发送请求端的 hosts文件,接受请求端的hosts文件 , hbase里的hbase.zookeeper.quorum 的值必须完全一致
本文介绍了启动HBase或通过JAVA代码连接HBase时遇到的SASL问题及错误信息,探讨了可能的原因包括IP地址配置不当和DNS解析问题,并提供了经过验证的解决方案,如检查hbase.rootdir配置和确保域名一致性。
548

被折叠的 条评论
为什么被折叠?



