docker-compose搭建consul集群环境

17次阅读
没有评论

共计 756 个字符,预计需要花费 2 分钟才能阅读完成。

学习文章

https://www.jianshu.com/p/b246ae1e1bcd

docker-compose.yaml 内容

version: '2'
networks:
  byfn:

services:
  consul1:
    image: consul
    container_name: node1
    command: agent -server -bootstrap-expect=3 -node=node1 -bind=0.0.0.0 -client=0.0.0.0 -datacenter=dc1
    networks:
      - byfn

  consul2:
    image: consul
    container_name: node2
    command: agent -server -retry-join=node1 -node=node2 -bind=0.0.0.0 -client=0.0.0.0 -datacenter=dc1
    depends_on:
        - consul1
    networks:
      - byfn

  consul3:
    image: consul
    container_name: node3
    command: agent -server -retry-join=node1 -node=node3 -bind=0.0.0.0 -client=0.0.0.0 -datacenter=dc1
    depends_on:
        - consul1
    networks:
      - byfn

  consul4:
    image: consul
    container_name: node4
    command: agent -retry-join=node1 -node=ndoe4 -bind=0.0.0.0 -client=0.0.0.0 -datacenter=dc1 -ui 
    ports:
      - 8500:8500
    depends_on:
        - consul2
        - consul3
    networks:
      - byfn
正文完
 0
Eric chan
版权声明:本站原创文章,由 Eric chan 于2022-02-28发表,共计756字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。