您的位置:首页 > 运维架构 > Docker

docker运行consul cluster

2017-04-22 18:22 323 查看
##docker-compose

version: '2'
services:
node-1:
image: shcoder/alpine-consul
hostname: node-1
ports:
- 8500:8500
environment:
- CONSUL_NODE_NAME=node-1
- CONSUL_BOOTSTRAP_EXPECT=3
- CONSUL_SERVER=true
- CONSUL_CLUSTER_IPS=node-2,node-3
- CONSUL_ENCRYPT=q7Gsg6LSdrtWFvBpw7vmdA==
node-2:
image: shcoder/alpine-consul
hostname: node-2
environment:
- CONSUL_NODE_NAME=node-2
- CONSUL_BOOTSTRAP_EXPECT=3
- CONSUL_SERVER=true
- CONSUL_CLUSTER_IPS=node-1,node-3
- CONSUL_ENCRYPT=q7Gsg6LSdrtWFvBpw7vmdA==
node-3:
image: shcoder/alpine-consul
hostname: node-3
environment:
- CONSUL_NODE_NAME=node-3
- CONSUL_BOOTSTRAP_EXPECT=3
- CONSUL_SERVER=true
- CONSUL_CLUSTER_IPS=node-1,node-2
- CONSUL_ENCRYPT=q7Gsg6LSdrtWFvBpw7vmdA==

访问
http://192.168.99.100:8500/ui/#/dc1/services



##doc

hashicorp-consul-changelog
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Consul