Skip to content
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

Closed
atinmu opened this issue Dec 30, 2015 · 8 comments
Closed

Failed to add member through etcdctl in docker containers #4101

atinmu opened this issue Dec 30, 2015 · 8 comments

Comments

@atinmu
Copy link

atinmu commented Dec 30, 2015

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 shows
tcp 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)

@sjpotter
Copy link
Contributor

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

--listen-peer-urls=http://0.0.0.0:7001 --listen-client-urls=http://0.0.0.0:4001

@adohe-zz
Copy link

@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?

@atinmu
Copy link
Author

atinmu commented Dec 31, 2015

@adohe : Its docker0 bridge, I didn't run the containers with -net=host

@atinmu
Copy link
Author

atinmu commented Dec 31, 2015

@sjpotter : I tried it, but no luck!

@adohe-zz
Copy link

@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.

@atinmu
Copy link
Author

atinmu commented Jan 1, 2016

@adohe the containers are reachable between themselves, ping works!

@xiang90
Copy link
Contributor

xiang90 commented Jan 1, 2016

@atinmu Are you able to ping the etcd ip on the network that etcdctl runs on?

@atinmu
Copy link
Author

atinmu commented Jan 4, 2016

I've figured out the problem. I was not supplying the initial parameters in a right manner.

@atinmu atinmu closed this as completed Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants