意心一忆 2018-06-07 16:00 采纳率: 40%
浏览 15389
已采纳

dubbo-admin启动时连接zookeeper失败

在Tomcat8.5发布dubbo-admin出现以下错误:
即dubbo-admin没有连上zookeeper.

ERROR curator.ConnectionState - Connection timed out for connection string (127.0.0.1:2181) and timeout (5000) / elapshttps://ask.csdn.net/questions/691453#ed (19803)
org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss
        at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:225)
        at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:94)
        at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:117)
        at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:489)
        at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:740)
        at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:723)
        at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:109)
        at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:720)
        at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:484)
        at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:474)
        at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:454)
        at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
        at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createPersistent(CuratorZookeeperClient.java:74)
        at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:63)
        at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doSubscribe(ZookeeperRegistry.java:149)
        at com.alibaba.dubbo.registry.support.FailbackRegistry.retry(FailbackRegistry.java:377)
        at com.alibaba.dubbo.registry.support.FailbackRegistry$1.run(FailbackRegistry.java:70)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

备注:
1.dubbo-admin的github下载地址为:https://github.com/apache/incubator-dubbo-ops
dubbo.properties配置文件内容为(未做修改过)
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.admin.root.password=root
dubbo.admin.guest.password=guest
2.dubbo-admin已正常启动,可正常访问http://localhost:8080/dubbo-admin-2.0.0/
3.zookeeper的版本的3.4.8,
4.操作系统为win10
5.验证zookeeper启动结果为:
查看端口占用情况:
C:\WINDOWS\system32>netstat -ano|findstr "2181"
TCP 0.0.0.0:2181 0.0.0.0:0 LISTENING 13908
TCP 127.0.0.1:2181 127.0.0.1:9049 CLOSE_WAIT 13908
TCP 127.0.0.1:2181 127.0.0.1:9062 CLOSE_WAIT 13908
TCP 127.0.0.1:2181 127.0.0.1:9082 ESTABLISHED 13908
TCP 127.0.0.1:9049 127.0.0.1:2181 FIN_WAIT_2 8340
TCP 127.0.0.1:9062 127.0.0.1:2181 FIN_WAIT_2 8340
TCP 127.0.0.1:9082 127.0.0.1:2181 ESTABLISHED 8340
TCP [::]:2181 [::]:0 LISTENING 13908

使用jps查看java进程情况:
C:\WINDOWS\system32>jps
13908 QuorumPeerMain
8340 Bootstrap
12376 Jps
8696 org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar

使用zookeeper客户端测试连接情况:
E:\zookeeper-3.4.8\bin>zkCli.cmd -server 127.0.0.1:2181
Connecting to 127.0.0.1:2181
2018-06-07 23:49:57,276 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.8--1, built on 02/06/2016 03:18 GMT
....
Welcome to ZooKeeper!
2018-06-07 23:49:57,598 [myid:] - INFO [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2018-06-07 23:49:57,600 [myid:] - INFO [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@876] - Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating session
JLine support is enabled
[zk: 127.0.0.1:2181(CONNECTING) 0]

  • 写回答

2条回答 默认 最新

  • threenewbee 2018-06-07 16:04
    关注

    Connection timed out for connection string (127.0.0.1:2181)
    连接不上,超时,检查下端口有没有开,防火墙,还有服务器那里的绑定

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 CCF-CSP 2023 第三题 解压缩(50%)
  • ¥30 comfyui openpose报错
  • ¥20 Wpf Datarid单元格闪烁效果的实现
  • ¥15 图像分割、图像边缘提取
  • ¥15 sqlserver执行存储过程报错
  • ¥100 nuxt、uniapp、ruoyi-vue 相关发布问题
  • ¥15 浮窗和全屏应用同时存在,全屏应用输入法无法弹出
  • ¥100 matlab2009 32位一直初始化
  • ¥15 Expected type 'str | PathLike[str]…… bytes' instead
  • ¥15 三极管电路求解,已知电阻电压和三级关放大倍数