赞
踩
docker network create --driver=bridge zoo
这边对应镜像使用的是 0.6.0,对应文件在 docker/0.6.0 目录下
将配置文件中 172.17.0.2 修改为 zk 的真实 ip,这边在同一个 docker 网络下,所以直接改为容器名。
server.port=38080
dubbo.protocol.port=30880
dubbo.application.qos-port=32222
# centers in dubbo2.7, if you want to add parameters, please add them to the url
admin.registry.address=zookeeper://172.17.0.2:2181
admin.config-center=zookeeper://172.17.0.2:2181
admin.metadata-report.address=zookeeper://172.17.0.2:2181
其他配置保持不变,将文件保存到 ./data/dubbo/dubbo-admin/properties
下。
admin.registry.address=zookeeper://zookeeper:2181
admin.config-center=zookeeper://zookeeper:2181
admin.metadata-report.address=zookeeper://zookeeper:2181
version: '3.1' networks: zoo: driver: bridge external: true services: zookeeper: image: "zookeeper:latest" container_name: "zookeeper" ports: - "2181:2181" environment: TZ: "Asia/Shanghai" volumes: - /etc/localtime:/etc/localtime:ro networks: - zoo dubbo-admin: image: "apache/dubbo-admin:latest" container_name: "dubbo-admin" environment: TZ: "Asia/Shanghai" volumes: - /etc/localtime:/etc/localtime:ro - ./data/dubbo/dubbo-admin/properties:/config ports: - "38080:38080" depends_on: - zookeeper networks: - zoo
进入 compose 文件所在目录,docker-compose up -d
访问: http://localhost:38080, 使用默认的用户密码 root/root,即可登录查看服务。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。