你会正确配置backup地址吗?
在配置dubbo注册中心时,一般会这样写
dubbo.registry.protocol=zookeeperdubbo.registry.address=127.0.0.1:2181
也会简单地写成
dubbo.registry.address=zookeeper://127.0.0.1:2181
当zookeeper地址不止一个,需要配置backup地址时,会这样写
dubbo.registry.protocol=zookeeperdubbo.registry.address=127.0.0.1:2181,127.0.0.1:2182
这时候如果你简写成这样
dubbo.registry.address=zookeeper://127.0.0.1:2181,127.0.0.1:2182
那就启动报错了~看下报错日志
java.lang.IllegalStateException: Failed to receive INITIALIZED event from zookeeper, pls. check if url zookeeper://127.0.0.1:2181,127.0.0.1:2182/org.apache.dubbo.metadata.report.MetadataReport?client=&dubbo.config-center.root-path=/ is correct
为什么会这样?