Why would you containerize mesos slave? Would you then run containers within a 
container?

Regards,

Kashif

On 27 Oct 2014, at 21:13, Grzegorz Graczyk 
<[email protected]<mailto:[email protected]>> wrote:

Change name of container for something else, it can't start with "mesos-" 
because that's how mesos knows which containers are managed by mesos. It just 
kills itself.
Are you running this on CoreOS?
Read this thread: 
https://www.mail-archive.com/[email protected]/msg01602.html

On 27 October 2014 18:33, Alessandro Siragusa 
<[email protected]<mailto:[email protected]>> wrote:
Hi all,

I’m trying to run mesos-slave in a Docker container with the containerizers 
docker,mesos :

$ docker run -ti --rm --name=mesos-slave --net=host -e 
MESOS_ISOLATOR=cgroups/cpu,cgroups/mem -e MESOS_CONTAINERIZERS=docker,mesos -e 
MESOS_HOSTNAME=slave-hostname -e MESOS_IP=1.2.3.4 -v 
/run/docker.sock:/run/docker.sock -v /sys:/sys -e MESOS_LOG_DIR=/var/log -e 
MESOS_MASTER=zk://ZOOKEEPER_IPS:2181/mesos -p 5051:5051 -e 
MESOS_CHECKPOINT=false  mesos-slave
I1027 16:53:04.851111     1 logging.cpp:142] INFO level logging started!
I1027 16:53:04.851359     1 main.cpp:126] Build: 2014-09-23 05:36:09 by root
I1027 16:53:04.851375     1 main.cpp:128] Version: 0.20.1
I1027 16:53:04.851384     1 main.cpp:131] Git tag: 0.20.1
I1027 16:53:04.851393     1 main.cpp:135] Git SHA: 
fe0a39112f3304283f970f1b08b322b1e970829d
I1027 16:53:05.853960     1 containerizer.cpp:89] Using isolation: 
posix/cpu,posix/mem
2014-10-27 16:53:05,854:1(0x7fd859eee700):ZOO_INFO@log_env@712: Client 
environment:zookeeper.version=zookeeper C client 3.4.5
2014-10-27 16:53:05,854:1(0x7fd859eee700):ZOO_INFO@log_env@716: Client 
environment:host.name<http://host.name>=slave-hostname
2014-10-27 16:53:05,854:1(0x7fd859eee700):ZOO_INFO@log_env@723: Client 
environment:os.name<http://os.name>=Linux
2014-10-27 16:53:05,854:1(0x7fd859eee700):ZOO_INFO@log_env@724: Client 
environment:os.arch=3.16.2+
2014-10-27 16:53:05,854:1(0x7fd859eee700):ZOO_INFO@log_env@725: Client 
environment:os.version=#2 SMP Wed Oct 1 20:08:48 UTC 2014
2014-10-27 16:53:05,854:1(0x7fd859eee700):ZOO_INFO@log_env@733: Client 
environment:user.name<http://user.name>=(null)
I1027 16:53:05.854481     1 main.cpp:149] Starting Mesos slave
I1027 16:53:05.854866    11 slave.cpp:167] Slave started on 
1)@1.2.3.4:5051<http://1.2.3.4:5051>
I1027 16:53:05.855069    11 slave.cpp:278] Slave resources: cpus(*):8; 
mem(*):31188; disk(*):447410; ports(*):[31000-32000]
I1027 16:53:05.855099    11 slave.cpp:306] Slave hostname: slave-hostname
I1027 16:53:05.855110    11 slave.cpp:307] Slave checkpoint: false
I1027 16:53:05.856284     6 state.cpp:33] Recovering state from 
'/tmp/mesos/meta'
I1027 16:53:05.856372     8 status_update_manager.cpp:193] Recovering status 
update manager
I1027 16:53:05.856470     6 containerizer.cpp:252] Recovering containerizer
I1027 16:53:05.856484     9 docker.cpp:577] Recovering Docker containers
2014-10-27 16:53:05,856:1(0x7fd859eee700):ZOO_INFO@log_env@741: Client 
environment:user.home=/root
2014-10-27 16:53:05,856:1(0x7fd859eee700):ZOO_INFO@log_env@753: Client 
environment:user.dir=/tmp
2014-10-27 16:53:05,856:1(0x7fd859eee700):ZOO_INFO@zookeeper_init@786: 
Initiating client connection, host=MASTERS:2181 sessionTimeout=10000 
watcher=0x7fd85de56a30 sessionId=0 sessionPasswd=<null> context=0x7fd828000f80 
flags=0
2014-10-27 16:53:05,862:1(0x7fd856a8c700):ZOO_INFO@check_events@1703: initiated 
connection to server [MASTER_IP:2181]
2014-10-27 16:53:05,865:1(0x7fd856a8c700):ZOO_INFO@check_events@1750: session 
establishment complete on server [REPLICA_IP:2181], 
sessionId=0x1494d70090e0025, negotiated timeout=10000
I1027 16:53:05.865543     7 group.cpp:313] Group process 
(group(1)@1.2.3.4:5051<http://1.2.3.4:5051>) connected to ZooKeeper
I1027 16:53:05.865581     7 group.cpp:787] Syncing group operations: queue size 
(joins, cancels, datas) = (0, 0, 0)
I1027 16:53:05.865608     7 group.cpp:385] Trying to create path '/mesos' in 
ZooKeeper
I1027 16:53:05.866819     6 detector.cpp:138] Detected a new leader: (id='7')
I1027 16:53:05.866902     8 group.cpp:658] Trying to get 
'/mesos/info_0000000007' in ZooKeeper
I1027 16:53:05.867444     7 detector.cpp:426] A new leading master 
(UPID=master@MASTER_IP:5050) is detected
I1027 16:53:07.855305    13 slave.cpp:3198] Finished recovery
I1027 16:53:07.855576    12 slave.cpp:589] New master detected at 
master@MASTER_IP:5050
I1027 16:53:07.855669    12 slave.cpp:625] No credentials provided. Attempting 
to register without authentication
I1027 16:53:07.855680     7 status_update_manager.cpp:167] New master detected 
at master@MASTER_IP:5050
I1027 16:53:07.855695    12 slave.cpp:636] Detecting new master

The process exits right after the last line.

If I don’t start the Docker containerizer everything works fine:

$ docker run -ti --rm --name=mesos-slave --net=host -e 
MESOS_ISOLATOR=cgroups/cpu,cgroups/mem -e MESOS_CONTAINERIZERS=mesos -e 
MESOS_HOSTNAME=slave-host -e MESOS_IP=1.2.3.4 -v 
/run/docker.sock:/run/docker.sock -v /sys:/sys -e MESOS_LOG_DIR=/var/log -e 
MESOS_MASTER=zk://ZOOKEEPER_IPS:2181/mesos -p 5051:5051 -e 
MESOS_CHECKPOINT=false mesos-slave
I1027 17:03:28.288579     1 logging.cpp:142] INFO level logging started!
I1027 17:03:28.288823     1 main.cpp:126] Build: 2014-09-23 05:36:09 by root
I1027 17:03:28.288838     1 main.cpp:128] Version: 0.20.1
I1027 17:03:28.288849     1 main.cpp:131] Git tag: 0.20.1
I1027 17:03:28.288857     1 main.cpp:135] Git SHA: 
fe0a39112f3304283f970f1b08b322b1e970829d
I1027 17:03:28.290194     1 containerizer.cpp:89] Using isolation: 
posix/cpu,posix/mem
I1027 17:03:28.290340     1 main.cpp:149] Starting Mesos slave
2014-10-27 17:03:28,290:1(0x7f89ef493700):ZOO_INFO@log_env@712: Client 
environment:zookeeper.version=zookeeper C client 3.4.5
2014-10-27 17:03:28,290:1(0x7f89ef493700):ZOO_INFO@log_env@716: Client 
environment:host.name<http://host.name>=slave-hostname
2014-10-27 17:03:28,290:1(0x7f89ef493700):ZOO_INFO@log_env@723: Client 
environment:os.name<http://os.name>=Linux
2014-10-27 17:03:28,290:1(0x7f89ef493700):ZOO_INFO@log_env@724: Client 
environment:os.arch=3.16.2+
2014-10-27 17:03:28,290:1(0x7f89ef493700):ZOO_INFO@log_env@725: Client 
environment:os.version=#2 SMP Wed Oct 1 20:08:48 UTC 2014
2014-10-27 17:03:28,290:1(0x7f89ef493700):ZOO_INFO@log_env@733: Client 
environment:user.name<http://user.name>=(null)
I1027 17:03:28.290735     8 slave.cpp:167] Slave started on 
1)@1.2.3.4:5051<http://1.2.3.4:5051>
I1027 17:03:28.290910     8 slave.cpp:278] Slave resources: cpus(*):8; 
mem(*):31188; disk(*):447410; ports(*):[31000-32000]
I1027 17:03:28.290946     8 slave.cpp:306] Slave hostname: slave-hostname
I1027 17:03:28.290964     8 slave.cpp:307] Slave checkpoint: false
I1027 17:03:28.292132    13 state.cpp:33] Recovering state from 
'/tmp/mesos/meta'
I1027 17:03:28.292201    12 status_update_manager.cpp:193] Recovering status 
update manager
I1027 17:03:28.292268    12 containerizer.cpp:252] Recovering containerizer
I1027 17:03:28.292431     8 slave.cpp:3198] Finished recovery
2014-10-27 17:03:28,292:1(0x7f89ef493700):ZOO_INFO@log_env@741: Client 
environment:user.home=/root
2014-10-27 17:03:28,292:1(0x7f89ef493700):ZOO_INFO@log_env@753: Client 
environment:user.dir=/tmp
2014-10-27 17:03:28,292:1(0x7f89ef493700):ZOO_INFO@zookeeper_init@786: 
Initiating client connection, host=ZOOKEEPER_IPS:2181 sessionTimeout=10000 
watcher=0x7f89f33fba30 sessionId=0 sessionPasswd=<null> context=0x7f89d0002580 
flags=0
2014-10-27 17:03:28,296:1(0x7f89e7fff700):ZOO_INFO@check_events@1703: initiated 
connection to server [REPLICA_IP:2181]
2014-10-27 17:03:28,297:1(0x7f89e7fff700):ZOO_INFO@check_events@1750: session 
establishment complete on server [REPLICA_IP:2181], 
sessionId=0x3494d6e6dc00013, negotiated timeout=10000
I1027 17:03:28.298100     7 group.cpp:313] Group process 
(group(1)@1.2.3.4:5051<http://1.2.3.4:5051>) connected to ZooKeeper
I1027 17:03:28.298125     7 group.cpp:787] Syncing group operations: queue size 
(joins, cancels, datas) = (0, 0, 0)
I1027 17:03:28.298138     7 group.cpp:385] Trying to create path '/mesos' in 
ZooKeeper
I1027 17:03:28.299088    12 detector.cpp:138] Detected a new leader: (id='7')
I1027 17:03:28.299154     9 group.cpp:658] Trying to get 
'/mesos/info_0000000007' in ZooKeeper
I1027 17:03:28.299595    10 detector.cpp:426] A new leading master 
(UPID=master@MASTER_IP:5050) is detected
I1027 17:03:28.299659     8 slave.cpp:589] New master detected at 
master@MASTER_IP:5050
I1027 17:03:28.299717     8 slave.cpp:625] No credentials provided. Attempting 
to register without authentication
I1027 17:03:28.299723     9 status_update_manager.cpp:167] New master detected 
at master@MASTER_IP:5050
I1027 17:03:28.299741     8 slave.cpp:636] Detecting new master
I1027 17:03:29.265413    12 slave.cpp:754] Registered with master 
master@MASTER_IP:5050; given slave ID 20141027-040801-148971440-5050-1-5

And therefore I can see this slave on the web interface of the master.

This is the Dockerfile of the container that I run:

$ cat Dockerfile
FROM redjack/mesos-slave

RUN apt-get install -y docker.io<http://docker.io>

In installed docker in the host to prevent the following error:

Failed to create a containerizer: Could not create DockerContainerizer: Failed 
to execute 'docker version': exited with status exited with status 127

I know that somebody managed to make it run in v0.19, but with v0.20 things 
have changed a lot, as far as I have understood. Any thoughts?

Thanks

Reply via email to