SofaBoot:4.2.0 不能使用 zookeeper 注册中吗?
zqiheng opened this issue · comments
当我使用 SofaBoot 4.2.0 做 RPC 测试时,集成 zookeeper 作为注册中心,但是在启动的时候直接报错了。
所以,我不知道是我的配置问题还是怎么回事,麻烦帮忙看下,谢谢!示例代码
SOFAPRC 的注册中心是可选的,因此单独引入 SOFARPC 的Starter 并不会引入所有注册中心的依赖,需要你引入下述依赖才能生效 ZK 注册中心:
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-x-discovery</artifactId>
</dependency>
另外,其他几个解析器也应该根据依赖需加载,这个会在后续版本中进行优化,同时给出更友好的错误提示。
非常感谢,添加上述依赖后,zookeeper 可以正常注册与使用。