zookeeper集群中有一个节点宕掉,注册中心连接失败
Closed this issue · 1 comments
alibner commented
Environment
- Dubbo version: 2.8.4
- Operating System version: CentOS6.5
- Java version: 1.7.0_17
- Zookeeper version: 3.4.6
Steps to reproduce this issue
- 配置注册中心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"/>
- 将上述其中一个节点宕掉,即客户端连接不上zk;我这边是zk02.domain.com 已经连不上,但10.1和10.3是OK的。
- 这个时候重启应用就会报错;并且启动失败。
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