作为主流的服务治理组件,Dubbo提供了很多丰富的功能,那么最根本的就是要解决大规模集群之后的服务注册和发现的问题。而dubbo中对于注册中心这块是使用zookeeper来支撑的。当然在目前最新的版本中。
Dubbo能够支持的注册中心有:consul、etcd、nacos、sofa、zookeeper、redis、multicast
使用zookeeper作为注册中心
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>4.0.0</version>
</dependency>