-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Running the official docker image for etcd will listen only on localhost. #8230
Comments
Seems like docker configuration issue, not etcd issue. |
It is not. Ping works fine. However curl does not. |
Shouldn't matter. Your etcd cluster started fine. Seems like you just need to expose port 2379. |
The logs shows that etcd is listening on localhost only. |
Yeah you need to either use host network for your etcd container, or expose client port 2379 to the container that your |
Here is a more detailed run. This clearly shows that etcd is not registering on anything but 127.0.0.1
run on AWS instance |
@ahoma-paymentus launching etcd as The commented out line:
is closer to what should be passed to etcd in order to expose it to the rest of the network via docker. |
And this is exactly the problem. etcd refuses to listen on all ports when specifying those options: |
Running: etcd fails to listen
|
Again the expose command has nothing to do with... moving on.. I run the following command: And this worked. So it looks etcd is not working when using -listen-client-urls http://0.0.0.0:2379, however it works when it is provided with local IP explicitly. Sound like a bug. |
@ahoma-paymentus FWIW I can not replicate your issue locally. docker-compose.yml
$ docker-compose up -d $ docker-compose exec etcd curl -sS http://127.0.0.1:2379/version $ container_ip=$(docker-compose exec etcd ifconfig eth0|grep -oP 'inet addr:\K\S+');echo container_ip=${container_ip} $ docker-compose exec etcd curl -sS http://172.18.0.2:2379/version $ curl -sS http://localhost:2379/version |
I think I found the problem. When running it on Docker Windows 10, it looks the containers are not running using IP6. Running ifconfig in the containers shows only IP4 address. etcd is trying to register on IP6 and it fails. Running the same on AWS image ifconfig returns IP4 and IP6 address. And etcd works. This problem is sidestepped when asking etcd to register on a specific IP4 ip. It looks etcd thinks the container is using IP6 when it's not. |
@ahoma-paymentus that should be fixed by #8221; it'll be in 3.2.3. |
Here is the sample docker-compose.yml that demonstrates the problem.
Here is the log:
The text was updated successfully, but these errors were encountered: