7

Dubbo2.7使用Zookeeper注册中心

 2 years ago
source link: https://laboo.top/2019/11/26/dbzk/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Dubbo2.7使用Zookeeper注册中心

Posted on

2019-11-26 Edited on 2021-12-15 In 环境部署

dubbo官方文档中关于集成zookeeper的说明在2.7.1版本下缺少了必要的步骤, 做此记录

  • Dubbo 2.7.1
  • Zookpper 3.5.5
  • Springboot 2.1.1.RELEASE

Maven

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.5.5</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>

# 服务端
dubbo:
application:
name: ${spring.application.name}
scan:
base-packages: test.dubbo
registry:
address: zookeeper://localhost:2181
protocol:
name: dubbo
port: 9999
# 客户端
dubbo:
application:
name: ${spring.application.name}
registry:
address: zookeeper://localhost:2181
protocol:
name: dubbo

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK