anyone successfully using marathon in a docker container?

670 views
Skip to first unread message

Dick Davies

unread,
Jun 11, 2014, 8:09:46 PM6/11/14
to marathon-...@googlegroups.com
I saw the Dockerfile in the github repo so thought I'd give it
a bash, built a 0.5.1 marathon container to talk to a mesos 0.18.2 cluster.

had to tweak it a bit to get it running (maven was having a bad day)
but i'm now able to get to the UI after mapping ports (docker host 8080
maps into the containers 8080) and try to launch
(python simpleserver type) tasks.
It doesn't get anywhere.

mesos UI shows marathon as a framework, but i see a lot of this on the master:

Jun 11 23:56:29 mesos-master1 mesos-master[8434]: I0611
23:56:29.366384 8452 master.cpp:815] Received registration request
from scheduler(1)@172.17.0.2:36395
Jun 11 23:56:29 mesos-master1 mesos-master[8434]: I0611
23:56:29.366482 8452 master.cpp:820] Framework
20140611-223448-1728053258-5050-8434-0004
(scheduler(1)@172.17.0.2:36395) already registered, resending
acknowledgement

note the IP is the docker containers internal IP. These messages just loop
and nothing gets deployed. the 'resending acknowledgement' part makes
me think mesos can't talk back to marathon so i'm dead in the water.

Is there a way to have marathon tell mesos how to reach it?
I tried '-h' but makes no difference apparently.

Just curious if anyone has got this working yet.

Michael Babineau

unread,
Jun 11, 2014, 8:33:28 PM6/11/14
to Dick Davies, marathon-...@googlegroups.com
Marathon doesn't let you configure the IP it passes to Mesos; it looks that up on its own. The same is true for most (all?) Mesos frameworks - I suspect it's part of the Mesos scheduler lib.

You have to convince Docker to use an IP that's addressable from the Mesos nodes. The quick and dirty way (hat tip to Tobi) is to launch the container with host networking via --net=host (see docs). Note this feature was introduced in Docker 0.11 and is incompatible with -h.

I've got Marathon running in a container right now, no problems since working out the initial kinks. Feel free to borrow/steal:

You can see how we launch it here:

Hope that helps,
Mike


--
You received this message because you are subscribed to the Google Groups "marathon-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marathon-framew...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tobi Knaup

unread,
Jun 11, 2014, 10:02:18 PM6/11/14
to Michael Babineau, Dick Davies, marathon-...@googlegroups.com
You can tell the Mesos driver that all frameworks use to advertise a different IP by setting LIBPROCESS_IP in the container env. That should do it.
Mike: I like your Dockerfile better than the one in the Marathon repo. Would love to see a PR!
--
Tobi Knaup
CTO & Founder

Dick Davies

unread,
Jun 12, 2014, 5:49:49 AM6/12/14
to Tobi Knaup, Michael Babineau, marathon-...@googlegroups.com
Thanks Tobi - that's what Google led me to believe too, but it seems
like setting that causes
a bind error.


Dockerfile : https://gist.github.com/rasputnik/155aa11277147178fe8f
image: https://registry.hub.docker.com/u/rasputnik/marathon0.5.1/

Confirmed the env is set (that ip == public interface of docker host, I can
get to marathon on 8080 on that ip)
...

"Env": [
"LIBPROCESS_IP=10.0.0.104",
"HOME=/",

"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
....

and the error (from Docker logs) is:

....
eper.ClientCnxn:950)
[2014-06-12 08:36:09,514] INFO Session establishment complete on
server 10.0.0.103/10.0.0.103:2181, sessionid = 0x1468c12faa70025,
negotiated timeout = 10000 (org.apache.zookeeper.ClientCnxn:739)
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0612 08:36:10.924558 11 process.cpp:1460] Failed to initialize,
bind: Cannot assign requested address [99]
*** Check failure stack trace: ***
/opt/marathon-0.5.1/bin/start: line 45: 10 Aborted
java "${java_args[@]}" -jar
"$FRAMEWORK_HOME"/target/marathon-*-jar-with-dependencies.jar
"${app_args[@]}"
....
Reply all
Reply to author
Forward
0 new messages