dangdangdotcom / dubbox

Dubbox now means Dubbo eXtensions, and it adds features like RESTful remoting, Kyro/FST serialization, etc to the Dubbo service framework.
http://dangdangdotcom.github.io/dubbox
Apache License 2.0
4.9k stars 2.06k forks source link

zookeeper集群中有一个节点宕掉,注册中心连接失败 #388

Closed alibner closed 5 years ago

alibner commented 5 years ago

Environment

Steps to reproduce this issue

  1. 配置注册中心zookeeper集群方式
    <dubbo:registry protocol="zookeeper" address="10.10.10.1:2181,zk02.domain.com:2181,10.10.10.3:2181" id="app_dubbo" group="dubbo" default="false"/>
  2. 将上述其中一个节点宕掉,即客户端连接不上zk;我这边是zk02.domain.com 已经连不上,但10.1和10.3是OK的。
  3. 这个时候重启应用就会报错;并且启动失败。

Expected Result

重启应用后,我希望注册中心在宕了一个zk节点的情况下,是可以使用另外两个OK的zk节点继续工作以保证我的应用正常启动。zookeeper集群如果只宕了一个我理解另外两个还是可用的。那为何不用另外两个OK的去注册呢。而是直接报错,并且启动。那如果是这样,zookeeper的集群模式又有何作用? 又或者是我们的使用方法有问题?

actual result

Exception: Error creating bean with name 'cityController': Unsatisfied dependency expressed through field 'areaSyncService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'areaSyncServiceImpl': Unsatisfied dependency expressed through field 'bossRemoteService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bizRemoteService': FactoryBean threw exception on object creation; nested exception is org.I0Itec.zkclient.exception.ZkException: Unable to connect to 10.10.10.1:2181,zk02.domain.com:2181,10.10.10.3:2181
alibner commented 5 years ago

这个问题在dubbo的2.5.7版本已经修复此问题。麻烦帮忙确认一下。 @li-shen