-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to add member through etcdctl in docker containers #4101
Comments
just a thought, but if it's only listening to localhost how would things in other containers be able to connect to it? i.e. perhaps needs something like
|
@atinmu I guess your Node 1 and Node 2 are two containers, are they on the same host or on different hosts? If on different hosts, what kind of network mode your containers use? |
@adohe : Its docker0 bridge, I didn't run the containers with -net=host |
@sjpotter : I tried it, but no luck! |
@atinmu I just want to say if both Node1 and Node2 are containers, and they are on different hosts(vms or bare mental), first you have to make sure these two containers can communicate. |
@adohe the containers are reachable between themselves, ping works! |
@atinmu Are you able to ping the etcd ip on the network that etcdctl runs on? |
I've figured out the problem. I was not supplying the initial parameters in a right manner. |
etcd/etcdctl version - 2.2.2
I brought up two docker containers and tried to set up a basic etcd cluster.
Node 1 IP : 172.17.0.2
Node 2 IP : 172.17.0.3
On Node 1
etcd --data-dir /tmp/etcd --name machine0 &
On Node 2
etcd --data-dir /tmp/etcd --name machine1 &
On both the nodes output of
netstat -nap| grep 2380
showstcp 0 0 127.0.0.1:2380 0.0.0.0:* LISTEN 1082/etcd
From node 1 when I trigger
etcdctl member add machine1 http://172.17.0.3:2380
it fails with following error:2015-12-30 07:30:36.437712 W | etcdserver: failed to reach the peerURL(http://172.17.0.3:2380) of member d99d2f74774ba445 (Get http://172.17.0.3:2380/version: dial tcp 172.17.0.3:2380: getsockopt: connection refused)
The text was updated successfully, but these errors were encountered: