上海古都建筑设计集团,上海办公室装修设计公司,上海装修公司高质量的内容分享社区,上海装修公司我们不是内容生产者,我们只是上海办公室装修设计公司内容的搬运工平台

ZooKeeper只完美解决Unable to read additional data from server sessionid 0x0报错问题,并带你深度理解ZooKeeper内部机制之选举机制

guduadmin21天前

ZooKeeper只完美解决Unable to read additional data from server sessionid 0x0报错问题,并带你深度理解ZooKeeper内部机制之选举机制

  • 一、问题描述
  • 二、原因分析
  • 三、解决方案

    🍅 作者简介:上火不找我,CSDN2022新星计划top4🏆、算法领域新星创造者💪

    🍅有什么问题直接私信作者,秒回哦💪💪💪


    一、问题描述

    Linux环境下

    今天搭建了一个zookeeper集群,分别为server2,server3,server4。

    ZooKeeper只完美解决Unable to read additional data from server sessionid 0x0报错问题,并带你深度理解ZooKeeper内部机制之选举机制,在这里插入图片描述,第1张

    报错如下:

    2022-08-08 22:10:44,294 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1240] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
    2022-08-08 22:10:45,716 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
    2022-08-08 22:10:45,717 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /0:0:0:0:0:0:0:1:41288, server: localhost/0:0:0:0:0:0:0:1:2181
    2022-08-08 22:10:45,718 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1240] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
    2022-08-08 22:10:47,382 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
    2022-08-08 22:10:47,383 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /0:0:0:0:0:0:0:1:41290, server: localhost/0:0:0:0:0:0:0:1:2181
    2022-08-08 22:10:47,384 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1240] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
    2022-08-08 22:10:48,849 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2022-08-08 22:10:48,850 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /127.0.0.1:39428, server: localhost/127.0.0.1:2181
    2022-08-08 22:10:48,852 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1240] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
    2022-08-08 22:10:50,397 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
    2022-08-08 22:10:50,398 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /0:0:0:0:0:0:0:1:41294, server: localhost/0:0:0:0:0:0:0:1:2181
    2022-08-08 22:10:50,399 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1240] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
    2022-08-08 22:10:52,214 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2022-08-08 22:10:52,215 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /127.0.0.1:39432, server: localhost/127.0.0.1:2181
    2022-08-08 22:10:52,217 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1240] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
    2022-08-08 22:10:54,073 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
    2022-08-08 22:10:54,074 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /0:0:0:0:0:0:0:1:41298, server: localhost/0:0:0:0:0:0:0:1:2181
    2022-08-08 22:10:54,077 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1240] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
    2022-08-08 22:10:55,613 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2022-08-08 22:10:55,614 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /127.0.0.1:39436, server: localhost/127.0.0.1:2181
    

    在一个节点上进入到zookeeper命令行执行zkCli.sh 时,报了下面这个异常!

    ZooKeeper只完美解决Unable to read additional data from server sessionid 0x0报错问题,并带你深度理解ZooKeeper内部机制之选举机制,在这里插入图片描述,第2张


    二、原因分析

    一开始我以为配置文件的错误,但是经过检查后发现并不是这里的问题,所以我开始思考zookeeper的搭建机制

    例如:半数机制:集群中半数以上机器存活,集群可用。所以Zookeeper适合安装奇数台服务器。


    三、解决方案

    例如你一次性启动了三台服务器,并且都使用zookeeper进行调度的话,就至少需要启动两台的zookeeper

    那么你只需要再启动一台机器的zookeeper,多按几下回车刷新就可以了

    ZooKeeper只完美解决Unable to read additional data from server sessionid 0x0报错问题,并带你深度理解ZooKeeper内部机制之选举机制,在这里插入图片描述,第3张

    🍅 作者简介:上火不找我,CSDN2022新星计划top4🏆、算法领域新星创造者💪

    🍅有什么问题直接私信作者,秒回哦💪💪💪

    🍅有帮助的记得给个三连支持一下,谢谢~~~💪💪💪

网友评论

搜索
最新文章
热门文章
热门标签