前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程。
一个项目启动不起来了,报错如题:
Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 5000
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1232)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:156)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:130)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:126)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:93)
at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient.<init>(ZkclientZookeeperClient.java:29)
at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperTransporter.connect(ZkclientZookeeperTransporter.java:10)
at com.alibaba.dubbo.remoting.zookeeper.ZookeeperTransporter$Adpative.connect(ZookeeperTransporter$Adpative.java)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.<init>(ZookeeperRegistry.java:69)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:37)
出错原因: zookeeper 地址配置错了,用的是已废弃的一个服务器上的 zookeeper 服务。
注释掉已废弃地址,改为最新地址:
#dubbo.registry.address=zookeeper://116.1xx.xx.xx:2181 // 已废弃地址
dubbo.registry.address=zookeeper://xxx.x4.1xx.xx:2181?register=false
dubbo.registry.client=zkclient
地址配置对了,服务就能正常启动了。