1、安装注册中心Zookeeper
docker pull zookeeper
docker run -d --name zookeeper01 --privileged=true -p 2181:2181 zookeeper
2、安装Dubbo-Admin可视化控制台
docker pull docker.io/apache/dubbo-admin
docker run -d --name dubbo-admin -p 9600:8080 \
-e admin.registry.address=zookeeper://sumeng.cloud:2181 \
-e admin.config-center=zookeeper://sumeng.cloud:2181 \
-e admin.metadata-report.address=zookeeper://sumeng.cloud:2181 \
docker.io/apache/dubbo-admin#注意:如果你要一行运行,就把 \ 去掉
3、新建父子模块项目dubbo-demo,dubbo-consumer,dubbo-producer
4、dubbo-demo父模块依赖如下
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ost</groupId>
<artifactId>dubbo-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<!-- 订单服务生产者 -->
<module>dubbo-producer</module>
<!-- 用户服务消费者 -->
<module>dubbo-consumer</module>
<