客户端报错:
org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss
查看服务端zookeeper日志发现:
EndOfStreamException: Unable to read additional data from client, it probably closed the socket: address = /175.190.113.233:1688, session = 0x0
at org.apache.zookeeper.server.NIOServerCnxn.handleFailedRead(NIOServerCnxn.java:163)
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:326)
at org.apache.zookeeper.server.NIOServerCnxnFactory$IOWorkRequest.doWork(NIOServerCnxnFactory.java:522)
at org.apache.zookeeper.server.WorkerService$ScheduledWorkRequest.run(WorkerService.java:154)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
原来是因为配置的超时时间太短,Zookeeper没有读完客户端的数据就被迫断开了连接。。
在application中设置connection-timeout的值为40000,再试一下。
重新启动服务,启动成功,耶。