Skip to content
This repository has been archived by the owner on Jun 22, 2018. It is now read-only.

localhost for container IPs for Master, Marathon, Zookeepr and Consul not working #542

Open
jbrinnand opened this issue Jul 29, 2017 · 3 comments

Comments

@jbrinnand
Copy link

jbrinnand commented Jul 29, 2017

When minimesos starts up on Mac it states: "Detected Mac Environment X so running with --mapPortsToHost so master and marathon ports are mapped to localhost."

And then after the cluster comes up: "You are running Docker on Mac so use localhost instead of container IPs for Master, Marathon, Zookeepr and Consul"

However, when I try to talk to Consul using the the following curl command: curl -X GET https://localhost:8500/v1/catalog; or use marathon with localhost:8080 - it fails. I have to always run: sudo route delete 172.17.0.0/16; sudo route -n add 172.17.0.0/16 $(docker-machine ip ${DOCKER_MACHINE_NAME}) in order to access any application or service running in the ecosystem.

Here is a test using telnet:

telnet localhost 8500
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host

But when I use the address provide on startup, things work as they should:

telnet 172.17.0.7 8500
Trying 172.17.0.7...
Connected to 172.17.0.7.
Escape character is '^]'.

The mac installation for minimesos is performed as recommended from: http://minimesos.readthedocs.io/en/0.13.0/#building-and-running-on-mac-with-docker-machine

Does the mapping to localhost only work if you are running Docker for Mac; or should this work on a Mac regardless? I think the latter. But I guess I am missing something.

@frankscholten
Copy link
Contributor

@jbrinnand Thanks for opening this issue!

The message "You are running Docker on Mac so use localhost instead of container IPs for Master, Marathon, Zookeepr and Consul" is incorrect.

Consul does not have port bindings that map 8500 on 172.17.0.17 to the host. Compare this to the master which does have port bindings. https://github.com/ContainerSolutions/minimesos/blob/master/minimesos/src/main/java/com/containersol/minimesos/mesos/MesosMasterContainer.java#L105

The same goes for Zookeeper which also does not have port bindings.

I will add an issue.

@frankscholten
Copy link
Contributor

#543

@jbrinnand
Copy link
Author

jbrinnand commented Aug 9, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants