栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

SASL config status: Will not attempt to authenticate using SASL (unknown error)

SASL config status: Will not attempt to authenticate using SASL (unknown error)

报错:
org.apache.zookeeper.ClientCnxn$EndOfStreamException: Unable to read additional data from server sessionid 0x108e8afac8f0077, likely server has closed socket

报错:
org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout

提示:
SASL config status: Will not attempt to authenticate using SASL (unknown error)

原因:
zookeeper默认使用了ZooKeeperSaslClient,而这个过程中调用了getHostName方法,这个方法会对传进去的字符串进行域名解析,即使是一个ip地址也会进行解析,而dns解析的快慢和服务器配置有关系,从而造成程序阻塞。

解决方式一:
可以通过在hosts文件添加上zookeeper的ip地址,使得getHostName可以直接使用hosts里面的dns结果。

解决方式二:
主动关闭ZooKeeperSaslClient,直接在SpringBoot启动类加System.setProperty(“zookeeper.sasl.client”, “false”); 例子如下

@SpringBootApplication
public class TestApplication {
    public static void main(String[] args) {
        System.setProperty("zookeeper.sasl.client", "false");
        SpringApplication.run(TestApplication.class, args);
    }
}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/758904.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号