docker运行consul cluster

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

docker运行consul cluster_第1张图片
屏幕快照 2017-04-22 下午3.54.24.png

doc

  • hashicorp-consul-changelog

你可能感兴趣的:(docker运行consul cluster)