频道栏目
首页 > 网络 > 云计算 > 正文

连接zookeeper报错怎么办?

2018-06-12 10:42:47      个评论    来源:practice  
收藏   我要投稿

连接zookeeper报错怎么办?

09:48:41,517  INFO ZooKeeper:100 - Client environment:user.name=cheng
09:48:41,517  INFO ZooKeeper:100 - Client environment:user.home=C:\Users\cheng
09:48:41,518  INFO ZooKeeper:100 - Client environment:user.dir=E:\eclipseworkspace01\pinyougou-parent\pinyougou-search-service
09:48:41,519  INFO ZooKeeper:438 - Initiating client connection, connectString=192.168.25.130:2881,192.168.25.130:2882,192.168.25.130:2883 sessionTimeout=60000 watcher=org.I0Itec.zkclient.ZkClient@25275eea
09:48:41,541  INFO ClientCnxn:1032 - Opening socket connection to server 192.168.25.130/192.168.25.130:2883. Will not attempt to authenticate using SASL (unknown error)
09:48:42,550  WARN ClientCnxn:1162 - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
09:48:42,662  INFO ClientCnxn:1032 - Opening socket connection to server 192.168.25.130/192.168.25.130:2882. Will not attempt to authenticate using SASL (unknown error)
09:48:42,662  INFO ClientCnxn:876 - Socket connection established to 192.168.25.130/192.168.25.130:2882, initiating session
09:48:46,541  INFO ZkEventThread:82 - Terminate ZkClient event thread.
09:49:02,664  WARN ClientCnxn:1108 - Client session timed out, have not heard from server in 20002ms for sessionid 0x0
09:49:02,768  INFO ZooKeeper:684 - Session: 0x0 closed
09:49:02,772  WARN XmlWebApplicationContext:546 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.listener.DefaultMessageListenerContainer#0' defined in file [E:\eclipseworkspace01\pinyougou-parent\pinyougou-search-service\target\classes\spring\applicationContext-jms-consumer.xml]: Cannot resolve reference to bean 'itemSearchListener' while setting bean property 'messageListener'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemSearchListener': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.pinyougou.search.service.ItemSearchService com.pinyougou.search.service.impl.ItemSearchListener.itemSearchService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemSearchServiceImpl' defined in file [E:\eclipseworkspace01\pinyougou-parent\pinyougou-search-service\target\classes\com\pinyougou\search\service\impl\ItemSearchServiceImpl.class]: Initialization of bean failed; nested exception is org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 5000
09:49:02,776  INFO ClientCnxn:519 - EventThread shut down for session: 0x0
09:49:02,780 ERROR ContextLoader:353 - Context initialization failed

错误原因:eclipse中连接zookeeper端口错误,应该配置为zoo.cfg中clientPort,而不是zookeeper集群之间通信的端口。
zookeeper集群中涉及到3个端口 zoo.cfg中: server.1=192.168.25.130:2881:3881,2881是zookeeper通信端口,3881是选举端口,clienPort是客户端连连接zookeeper端口

上一篇:Maven入门-Maven是什么?
下一篇:matlab中LinearAnalysisTool中图型数据导出方法
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站