'rafthttp: failed to find member' Error When Creating ETCD Cluster of 2 Nodes In Docker #16138
Unanswered
dev-vaayen
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Hey @Anand11Yash there are quite a few issues in the
Try something like this, it worked for me: REGISTRY=quay.io/coreos/etcd
ETCD_VERSION=3.5.9
TOKEN=my-etcd-token
CLUSTER_STATE=new
NAME_1=etcd-node-1
NAME_2=etcd-node-2
CLUSTER=${NAME_1}=http://${NAME_1}:2380,${NAME_2}=http://${NAME_2}:2381
DATA_DIR_1=etcd1
DATA_DIR_2=etcd2
docker network create etcd
# For node 1
docker run -d \
-p 2379:2379 \
-p 2380:2380 \
--volume=${DATA_DIR_1}:/etcd-data \
--network etcd \
--hostname ${NAME_1} \
--name etcd1 ${REGISTRY}:v${ETCD_VERSION} \
/usr/local/bin/etcd \
--data-dir=/etcd-data --name etcd-node-1 \
--initial-advertise-peer-urls http://${NAME_1}:2380 --listen-peer-urls http://0.0.0.0:2380 \
--advertise-client-urls http://${NAME_1}:2379 --listen-client-urls http://0.0.0.0:2379 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN}
# For node 2
docker run -d \
-p 2378:2378 \
-p 2381:2381 \
--volume=${DATA_DIR_2}:/etcd-data \
--network etcd \
--hostname ${NAME_2} \
--name etcd2 ${REGISTRY}:v${ETCD_VERSION} \
/usr/local/bin/etcd \
--data-dir=/etcd-data --name etcd-node-2 \
--initial-advertise-peer-urls http://${NAME_2}:2381 --listen-peer-urls http://0.0.0.0:2381 \
--advertise-client-urls http://${NAME_2}:2378 --listen-client-urls http://0.0.0.0:2378 \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN} After running this I was able to run +------------------+---------+-------------+-------------------------+-------------------------+------------+
| ID | STATUS | NAME | PEER ADDRS | CLIENT ADDRS | IS LEARNER |
+------------------+---------+-------------+-------------------------+-------------------------+------------+
| c30625e8a8c1af | started | etcd-node-2 | http://etcd-node-2:2381 | http://etcd-node-2:2378 | false |
| 7aa84c8b1d0c8bb4 | started | etcd-node-1 | http://etcd-node-1:2380 | http://etcd-node-1:2379 | false |
+------------------+---------+-------------+-------------------------+-------------------------+------------+
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone
I am trying to create an etcd cluster with 2 nodes using Docker on my system. Please note that I am doing all this on a single system.
The script that I have created for clustering is based on the commands provided on the v3.5 document for creating multi-node cluster in Docker. My script has been provided below, please let me know if there is any issue with it:
The output after running this script is as follows:
Please let me know what I am doing wrong and if my approach to creating a 2 node etcd cluster using Docker is correct or not.
Beta Was this translation helpful? Give feedback.
All reactions