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

# The number of milliseconds of each tick

tickTime=2000

# The number of ticks that the initial

# synchronization phase can take

initLimit=10

# The number of ticks that can pass between

# sending a request and getting an acknowledgement

syncLimit=5

# the directory where the snapshot is stored.

dataDir=/tmp/zookeeper

# the port at which the clients will connect

clientPort=2181

server.1=172.16.1.159:2888:3888

server.2=172.16.1.123:2888:3888

server.3=172.16.1.22:2888:3888

在启动zkCli.sh 的时候就出现了日志信息无限重复打印,内容如下:

2017-10-23 10:57:14,816 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:15,036 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:15,036 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:15,037 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:15,663 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:15,663 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:15,664 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:16,190 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:16,190 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:16,191 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:16,358 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:16,359 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:16,359 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:16,773 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:16,773 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:16,774 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:17,025 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:17,025 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:17,026 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:17,300 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:17,300 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:17,301 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:18,229 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:18,230 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:18,231 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:18,747 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:18,747 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:18,748 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:19,451 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:19,452 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:19,453 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:20,012 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:20,012 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:20,013 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:20,947 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:20,947 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:20,948 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:21,907 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:21,907 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:21,908 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:22,545 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:22,545 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:22,546 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:22,764 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:22,765 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:22,765 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:23,370 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:23,371 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-10-23 10:57:23,372 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:24,093 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
2017-10-23 10:57:24,094 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2017-10-23 10:57:24,094 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2017-10-23 10:57:25,148 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-10-23 10:57:25,148 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@947] - Socket connection established to localhost/127.0.0.1:2181, initiating session

使用dubbo添加服务的时候也添加不上,在网上查找原因,说是可能jar包版本与zookeeper版本不一致,然后去核对版本,发现版本号一致的情况下也无法注册服务。之后又去核对myid文件,发现也没有错误。

后来才搞明白,由于我在zoo.cfg中配置了3台机器,但是只启动了1台,zookeeper就会认为服务处于不可用状态。
zookeeper有个选举算法,当整个集群超过半数机器宕机,zookeeper会认为集群处于不可用状态。
所以,3台机器启动1台无法连接,如果启动2台及以上就可以连接了。

关于Unable to read additional data from server sessionid 0x0问题的解决。相关推荐

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

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

  2. zookeeper Unable to read additional data from server sessionid 0x0

    问题描述 项目是springboot 项目,通过dubbo 对各个模块进行调用,在项目启动的时候,zookeeper 客户端报如下错误. Unable to read additional data ...

  3. Zookeeper报错:Unable to read additional data from server sessionid 0x

    报错信息 INFO [main-SendThread(localhost:12181):ClientCnxn$SendThread@959] - Socket connection establish ...

  4. Zookeeper客户端错误 Unable to read additional data from server

    发现问题: 线上环境收到错误告警邮件,错误信息 keeperErrorCode = ConnectionLoss 解决问题: 1.分析错误信息得出,zk连接出了问题,先重启项目(项目重启后就恢复了正常 ...

  5. zookeeper连接,报caught end of stream exception EndOfStreamException: Unable to read additional data fro

    最近发现线上的zookeeper的日志zookeeper.out 文件居然有6G,后来设置下日志为滚动输出,但是改了之后,发现一天的日志量就是100多M,滚动日志一天就被冲掉了,这个不科学. 再仔细查 ...

  6. 启动oracle时报错:PuTTY X11 proxy: unable to connect to forwarded X server: Network error:

    在启动oracle时报如下错误是因为没有启动Xming,确保Xming启动之后再启动oracle即可. [oracle@localhost ~]$ cd /data/oracle/product/19 ...

  7. 201208197PM-Error on Unable to obtain lock on *.lok . Server may already be running

    When you try to start weblogic server and if this fails with error message that "Unable to obta ...

  8. SAP WM初阶之移动类型设置里的Additional Data?

    1, 在WM的移动类型设置了,有一个栏位叫做AddlData的,如下图示: 大多数情况下,这个栏位都是空(Do not transmit screen window).如果将其改为X,会是什么效果? ...

  9. Populating Additional data in Material master record

    主要解决禁用MM02 事务码后,用户需要更改物料主数据,所做的customer transaction. *&----------------------------------------- ...

  10. Unable to connect to the frida server: this feature requires an iOS Developer Disk Image to be mount

    ios使用frida调试的时候遇到该问题,解决方案 Unable to connect to the frida server: this feature requires an iOS Develo ...

最新文章

  1. java 反射 慢在那里_Java 反射到底慢在哪?
  2. linux kernel 中mdelay() 与msleep()的区别
  3. 委托、事件与Observer设计模式
  4. 岗位推荐 | 腾讯招聘自然语言处理方向实习生
  5. 深度学习(三十)贪婪深度字典学习
  6. 豆瓣、唱吧、爱回收等106款应用被工信部下架
  7. Java文件传输带宽控制_如何限制Java中的带宽?
  8. java中怎么输入中文_MultiMC下载-MultiMC中文实用版 v1.0
  9. 倍升工作效率的小策略
  10. 6.1 手机时钟系统简介
  11. Python 1-10 字符串操作
  12. ElasticSearch实现搜索和关键字高亮显示
  13. 教你cad版本怎么用转换器转换操作
  14. echarts5.0引入地图,背景渐变色,航线图,地图阴影
  15. 量化股票是什么意思?
  16. cdoj1337郭大侠与阴阳家
  17. Linux搭建LDAP Account Manager(LAM)
  18. Activiti流程操作
  19. 图形学 - 纹理的应用
  20. phpnow升级mysql_apache+phpnow+mysql,即phpnow搭建网站的前后台

热门文章

  1. HDU - 6287 口算训练 (二分+思维)
  2. go实现文档中保存的微信图片.dat格式解密为图片
  3. ccProxy软件实现网络共享
  4. java 对象判断null_Java判断对象是否为null的方法
  5. Ubuntu20安装RTL8811/RTL8812无线网卡驱动
  6. python爬虫爬取百度图片
  7. 数值积分 (一)| 基本思想 + 一般求积公式
  8. 校园招聘 - 面试指南
  9. Unity 透视相机世界和屏幕坐标系转换
  10. token与refresh_token