Skip to content

Instantly share code, notes, and snippets.

@liuliqiang
Created March 3, 2022 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liuliqiang/f3474b9c2984930a07875fc2d273175e to your computer and use it in GitHub Desktop.
Save liuliqiang/f3474b9c2984930a07875fc2d273175e to your computer and use it in GitHub Desktop.
etcd docker compose
version: '2'
services:
etcd0:
image: quay.io/coreos/etcd
ports:
- 2379
volumes:
- etcd0:/etcd_data
command:
- /usr/local/bin/etcd
- -name
- etcd0
- --data-dir
- /etcd_data
- -advertise-client-urls
- http://etcd0:2379
- -listen-client-urls
- http://0.0.0.0:2379
- -initial-advertise-peer-urls
- http://etcd0:2380
- -listen-peer-urls
- http://0.0.0.0:2380
- -initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
etcd1:
image: quay.io/coreos/etcd
ports:
- 2379
volumes:
- etcd1:/etcd_data
command:
- /usr/local/bin/etcd
- -name
- etcd1
- --data-dir
- /etcd_data
- -advertise-client-urls
- http://etcd1:2379
- -listen-client-urls
- http://0.0.0.0:2379
- -initial-advertise-peer-urls
- http://etcd1:2380
- -listen-peer-urls
- http://0.0.0.0:2380
- -initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
etcd2:
image: quay.io/coreos/etcd
ports:
- 2379
volumes:
- etcd2:/etcd_data
command:
- /usr/local/bin/etcd
- -name
- etcd2
- --data-dir
- /etcd_data
- -advertise-client-urls
- http://etcd2:2379
- -listen-client-urls
- http://0.0.0.0:2379
- -initial-advertise-peer-urls
- http://etcd2:2380
- -listen-peer-urls
- http://0.0.0.0:2380
- -initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
etcd-browser:
build: ../../etcd-browser
ports:
- 8000
environment:
ETCD_HOST: etcd0
ETCD_PORT: 2379
depends_on:
- etcd0
volumes:
etcd0:
etcd1:
etcd2:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment