minimesos icon indicating copy to clipboard operation
minimesos copied to clipboard

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

Open jbrinnand opened this issue 8 years ago • 3 comments

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.

jbrinnand avatar Jul 29 '17 23:07 jbrinnand

@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 avatar Aug 07 '17 10:08 frankscholten

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

frankscholten avatar Aug 07 '17 10:08 frankscholten

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

On Aug 7, 2017 3:47 AM, "Frank Scholten" [email protected] 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 .

jbrinnand avatar Aug 09 '17 00:08 jbrinnand