ContainerSolutions / minimesos

The experimentation and testing tool for Apache Mesos - NO LONGER MAINTANED!
https://www.minimesos.org
Apache License 2.0
428 stars 61 forks source link

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

Open jbrinnand opened 7 years ago

jbrinnand commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

https://github.com/ContainerSolutions/minimesos/issues/543

jbrinnand commented 7 years ago

Thanks for looking into it. BTW - we are fans of moniker is.

On Aug 7, 2017 3:47 AM, "Frank Scholten" notifications@github.com wrote:

543 https://github.com/ContainerSolutions/minimesos/issues/543

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ContainerSolutions/minimesos/issues/542#issuecomment-320632037, or mute the thread https://github.com/notifications/unsubscribe-auth/AAj2MTA3GeABEaNgbWPf1WuhwSTsN7Hzks5sVutYgaJpZM4OnfoW .