#描述:
启动 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 的值必须完全一致