mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-01 21:41:45 +00:00
Update etcd to 3.x #275
This commit is contained in:
112
etcd/demo/cluster/docker-compose.yml
Normal file
112
etcd/demo/cluster/docker-compose.yml
Normal file
@@ -0,0 +1,112 @@
|
||||
version: "3"
|
||||
services:
|
||||
|
||||
node1:
|
||||
image: quay.io/coreos/etcd
|
||||
volumes:
|
||||
- node1-data:/etcd-data
|
||||
expose:
|
||||
- 2379
|
||||
- 2380
|
||||
networks:
|
||||
cluster_net:
|
||||
ipv4_address: 172.16.238.100
|
||||
environment:
|
||||
- ETCDCTL_API=3
|
||||
command:
|
||||
- /usr/local/bin/etcd
|
||||
- --data-dir=/etcd-data
|
||||
- --name
|
||||
- node1
|
||||
- --initial-advertise-peer-urls
|
||||
- http://172.16.238.100:2380
|
||||
- --listen-peer-urls
|
||||
- http://0.0.0.0:2380
|
||||
- --advertise-client-urls
|
||||
- http://172.16.238.100:2379
|
||||
- --listen-client-urls
|
||||
- http://0.0.0.0:2379
|
||||
- --initial-cluster
|
||||
- node1=http://172.16.238.100:2380,node2=http://172.16.238.101:2380,node3=http://172.16.238.102:2380
|
||||
- --initial-cluster-state
|
||||
- new
|
||||
- --initial-cluster-token
|
||||
- docker-etcd
|
||||
|
||||
node2:
|
||||
image: quay.io/coreos/etcd
|
||||
volumes:
|
||||
- node2-data:/etcd-data
|
||||
networks:
|
||||
cluster_net:
|
||||
ipv4_address: 172.16.238.101
|
||||
environment:
|
||||
- ETCDCTL_API=3
|
||||
expose:
|
||||
- 2379
|
||||
- 2380
|
||||
command:
|
||||
- /usr/local/bin/etcd
|
||||
- --data-dir=/etcd-data
|
||||
- --name
|
||||
- node2
|
||||
- --initial-advertise-peer-urls
|
||||
- http://172.16.238.101:2380
|
||||
- --listen-peer-urls
|
||||
- http://0.0.0.0:2380
|
||||
- --advertise-client-urls
|
||||
- http://172.16.238.101:2379
|
||||
- --listen-client-urls
|
||||
- http://0.0.0.0:2379
|
||||
- --initial-cluster
|
||||
- node1=http://172.16.238.100:2380,node2=http://172.16.238.101:2380,node3=http://172.16.238.102:2380
|
||||
- --initial-cluster-state
|
||||
- new
|
||||
- --initial-cluster-token
|
||||
- docker-etcd
|
||||
|
||||
node3:
|
||||
image: quay.io/coreos/etcd
|
||||
volumes:
|
||||
- node3-data:/etcd-data
|
||||
networks:
|
||||
cluster_net:
|
||||
ipv4_address: 172.16.238.102
|
||||
environment:
|
||||
- ETCDCTL_API=3
|
||||
expose:
|
||||
- 2379
|
||||
- 2380
|
||||
command:
|
||||
- /usr/local/bin/etcd
|
||||
- --data-dir=/etcd-data
|
||||
- --name
|
||||
- node3
|
||||
- --initial-advertise-peer-urls
|
||||
- http://172.16.238.102:2380
|
||||
- --listen-peer-urls
|
||||
- http://0.0.0.0:2380
|
||||
- --advertise-client-urls
|
||||
- http://172.16.238.102:2379
|
||||
- --listen-client-urls
|
||||
- http://0.0.0.0:2379
|
||||
- --initial-cluster
|
||||
- node1=http://172.16.238.100:2380,node2=http://172.16.238.101:2380,node3=http://172.16.238.102:2380
|
||||
- --initial-cluster-state
|
||||
- new
|
||||
- --initial-cluster-token
|
||||
- docker-etcd
|
||||
|
||||
volumes:
|
||||
node1-data:
|
||||
node2-data:
|
||||
node3-data:
|
||||
|
||||
networks:
|
||||
cluster_net:
|
||||
driver: bridge
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
-
|
||||
subnet: 172.16.238.0/24
|
Reference in New Issue
Block a user