Connection refused Will not attempt to authenticate using SASL

本文介绍了启动HBase或通过JAVA代码连接HBase时遇到的SASL问题及错误信息,探讨了可能的原因包括IP地址配置不当和DNS解析问题,并提供了经过验证的解决方案,如检查hbase.rootdir配置和确保域名一致性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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


为什么出现如下报错[localhost][demo-hello][2025-07-17 15:31:29.305][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error) [localhost][demo-hello][2025-07-17 15:31:31.347][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Socket error occurred: localhost/0:0:0:0:0:0:0:1:2181: Connection refused: no further information [localhost][demo-hello][2025-07-17 15:31:32.449][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) [localhost][demo-hello][2025-07-17 15:31:34.464][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Socket error occurred: localhost/127.0.0.1:2181: Connection refused: no further information [localhost][demo-hello][2025-07-17 15:31:35.302][ERROR][24992][ main][o.a.c.ConnectionState ] : [] [] [] Connection timed out for connection string (localhost:2181) and timeout (5000) / elapsed (18644) org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:225) at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:94) at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:117) at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:489) at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:237) at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:226) at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:109) at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForegroundStandard(ExistsBuilderImpl.java:223)
最新发布
07-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值