I have tried using Marathon framework to deploy only one instance of MySQL container on the web UI to test the functions of Apache Mesos. The problem is that it run and deployed so many containers at a time even though I've stated only one instance. But after letting the process "sleep for 10s" to find out about the problem, I found out that it actually run 4 containers at a time. Any help?
Asked
Active
Viewed 443 times
0
-
Do these containers correspond to multiple Running tasks in the Mesos UI? Or do they show up as Completed tasks? If you were to, for example, use the `docker run -d` command to launch a container and detach, Mesos would think that the task had completed and report it as such to Marathon, which would then try to restart it and create a new container. – Adam Feb 01 '15 at 06:44
-
Yeah the containers correspond to multiple Running tasks. And this is how I run my MySQL container: docker run -d centos6mysql. I did not include port mapping in the run command though. I included 3306 on the port textbox. – Hans Feb 02 '15 at 01:12
-
1Marathon expects your task to continue running in the foreground. If you use `docker run -d` to detach the container and run it in the background, then Marathon thinks your command has exited. Try removing the `-d` – Adam Feb 02 '15 at 23:50
-
Thanks it finally FINISHED the task. However, when I head to list the docker containers that is active using docker ps, it does not show the MySQL container. Maybe, this time it have something to do with my Slave? Cause I used standalone way to deploy the Mesos/Marathon since I only have 1 server. – Hans Feb 03 '15 at 04:13
-
So, I run my container like this: docker run -p 3306:3306 centos6mysql. And I've checked the stderr file on MySQL container. It says level="FATAL" msg="POST http:///var/run/docker.sock/v1.16/containers/create: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?" – Hans Feb 03 '15 at 09:48
-
Are you running the mesos-slave inside a Docker container as well? You'll need to use privileged mode and create volumes like `-v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker:ro` – Adam Feb 03 '15 at 15:11
-
Nope I run the mesos-slave along with my mesos-master on the same server without containerizing them. I followed his way: http://frankhinek.com/setup-standalone-mesos-on-ubuntu/ – Hans Feb 04 '15 at 01:31
-
If you're launching docker containers through Marathon, you shouldn't be entering the `docker run...` command in yourself. Marathon/Mesos will handle that for you. You can, however, override the docker image's default command by setting Marathon's `cmd` or `args` fields. See https://mesosphere.github.io/marathon/docs/native-docker.html and make sure you have `--containerizers='docker,mesos'` on the slave command-line, or in `/etc/mesos-slave/containerizers` – Adam Feb 05 '15 at 04:39
-
It finally worked. I'm able to deploy the containers with JSON file. I believed it might be the way I setup my mesos cluster that prevent me to run these containers. Anyway, thanks for your help @Adam :) – Hans Feb 05 '15 at 08:05