I need to bootstrap 5 etcd containers onto a single node (temporary measure, eventually they’ll have their own nodes).
I’m not sure of the best way to go about it, I’ve tried many ways, with no success. The etcd nodes will talk with patroni services on other VMs.
Here’s what I’ve tried: I’ve built docker containers with etcd 3.4.13 installed in /opt/etcd
I run the containers this way, all on the same VM (192.168.11.21) docker run -d –network host –name etcd$ NODE_NUMBER –hostname etcd$ NODE_NUMBER -v /containers/$ NODE_NUMBER:/etcd etcd_image
I run this 5 times, on the same node. I map /containers/$ NODE_NUMBER on the VM to /etcd in the container. This directory contains the etcd.yaml config file for each node
The config is mostly the same in every file :
- listen-peer-urls points to http://192.168.11.21:{11380|12380|13380|14380|15380}
- listen-client-urls points to http://192.168.11.21:{11379|12379|13379|14379|15379}
- advertise-client-urls: ‘http://localhost:2379,http://192.168.11.21:{11379|12379|13379|14379|15379}
- initial-cluster: ‘etcd1=http://192.168.11.21:11380,etcd2=http://192.168.11.21:12380,etcd3=http://192.168.11.21:13380,etcd4=http://192.168.11.21:14380,etcd5=http://192.168.11.21:15380
- heartbeat-interval: 1000
- election-timeout: 5000
The containers spin up, the etcd services start, but it looks like I have 5 split brains ! etcdctl member list show no leader (value = false).
I’m at my wits’ end.
://10.6.17.20:15380