Infra
I am trying to set up a mesos<->marathon cluster distributing containers. On my main server I have:
- zookeeper
- docker registry v2 (port 5000) wo credentials
- a container with supervisord + mesos + marathon
Furthermore I have a slave (on the same server).
$docker ps
192.168.0.38:5000/mesos-slave:prod mesos-slave-1
192.168.0.38:5000/mesos-master:generic mesos-master
jplock/zookeeper 0.0.0.0:2181->2181/tcp, 0.0.0.0:2888->2888/tcp, 0.0.0.0:3888->3888/tcp nostalgic_visvesvaraya
registry:2 0.0.0.0:5000->5000/tcp registry
Issue
My issue is that I can't have marathon sending a docker image to the slave.
I think this comes from the configuration of the slave.
$ docker exec -ti mesos-slave-1 /bin/bash
root@xw8600-Workstation:/# docker info
Get http:///var/run/docker.sock/v1.19/info: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
The issue is on the {dial unix /var/run/docker.sock: no such file or directory}.
Slave's Dockerfile
The Dockerfile for the slave looks more or less like that :
FROM 192.168.0.38:5000/supervisor:prod
RUN apt-get -y --fix-missing update
RUN apt-get install -y --force-yes mesos
#Mesos
RUN echo 'docker,mesos' > /etc/mesos-slave/containerizers
RUN echo '5mins' > /etc/mesos-slave/executor_registration_timeout
COPY mesos-slave.conf /etc/supervisor/conf.d/mesos-slave.conf
CMD supervisord -c /etc/supervisor.conf
The mesos-slave.conf looks like that :
[program:mesos-slave]
command=mesos-slave --master=%(ENV_MASTER)s --ip=%(ENV_IP)s --hostname=%(ENV_HOSTNAME)s --resources=%(ENV_RESOURCES)s --attributes=%(ENV_ATTRIBUTES)s --port=%(ENV_SLAVE_PORT)s --log_dir=/etc/mesos/logs --containerizers=docker,mesos --no-switch_user
I get always the same error on the error log. Example to pull rstudio :
failed to start: Failed to 'docker -H unix:///var/run/docker.sock pull 192.168.0.38:5000:rocker/rstudio': exit status = exited with status 1 stderr = Post http:///var/run/docker.sock/v1.19/images/create?fromImage=192.168.0.38%3A5000%3Arocker%2Frstudio%3Alatest: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
What do I do wrong ?
Edit
It seems I can not start docker
root@xw8600-Workstation:/var/log/upstart# sudo /etc/init.d/docker status
* Docker is not running
root@xw8600-Workstation:/var/log/upstart# sudo /etc/init.d/docker start
* Starting Docker: docker
...done.
root@xw8600-Workstation:/var/log/upstart# sudo /etc/init.d/docker status
* Docker is not running
Edit 2
Following my question here : I have a mesos slave (v1.7) on which I try to get a docker in docker running. When I am inside the container, I get the following error log :
$ cat /var/log/docker.log
time="2015-10-17T12:27:40.963674511Z" level=fatal msg="Error starting daemon: error initializing graphdriver: operation not permitted"
I can't find much info on internet, here are some similar questions:
You cannot restart docker within a docker container. You can run docker within a docker containers But restarting? (Correct me if I'm wrong)
Essentially, you are stopping the docker daemon in your container 'xw8600-Workstation' while the container itself is using the very same docker daemon.
A better architecture is to just have your mesos-slave in a plain VM or bare-metal then run your docker daemon there and let mesos/marathon manage your resources through Docker. Hope it makes sense.
I run a completely dockerized Mesos/Marathon infrastructure on CoreOS. If you want to have a look at the
systemd
service definitions, feel free...I think you're missing to pass in the Docker unix socket and the
cgroups
to your slave container, seeDocker run command:
Personally, I'd also run another separate container for Marathon, instead of having it in the same image as the Mesos Master, but that may be a matter of taste.