Codious-JR
Codious-JR

Reputation: 1748

Marathon Docker Tasks Failing

I have setup Marathon and Mesos on two of my machines. I can successfully schedule commands from the marathon web console, but when I try to schedule a job involving docker images I immediately get job failed. Plus I get no stderr or stdout files.

Example Running a normal command:

Marathon job conf:
    {
      "id": "testecho",
      "cmd": "echo hello; sleep 10",
      "cpus": 1,
      "mem": 128,
      "disk": 0,
      "instances": 1
    }

On mesos I see that the tasks have succeeded. I have the stderr and stdout files like normal.

mesos: simple command job success

But now if I run a simple docker image task:

Marathon job conf:

        {
      "id": "/ubuntu",
      "cmd": "date -u +%T",
      "cpus": 0.5,
      "mem": 512,
      "disk": 0,
      "instances": 1,
      "container": {
        "type": "DOCKER",
        "volumes": [],
        "docker": {
          "image": "libmesos/ubuntu",
          "network": null,
          "portMappings": null,
          "privileged": false,
          "parameters": [],
          "forcePullImage": false
        }
      },
      "portDefinitions": [
        {
          "port": 10001,
          "protocol": "tcp",
          "labels": {}
        }
      ]
    }

On mesos, I see that it has instantly failed:

mesos: docker job failed

And I have no stderr or stdout files:

No stderr or stdout files

I also notice that on both my machines, when I run:

docker ps -a

I see nothing on both the machines. So that would mean that the docker jobs were not even launched

What could be affecting docker deployment?

The one reason I can think of is that the user that marathon uses to launch tasks not have access to docker? How do I test this?

I noticed that when I run the command:

sudo cat /etc/passwd

I see a user zookeeper. Maybe this is the user that doesn't have access to docker?

But when i do:

  su zookeeper

I don't change user profiles

Upvotes: 4

Views: 405

Answers (1)

Codious-JR
Codious-JR

Reputation: 1748

After going through a few tutorials I found the answer from the following tutorial: http://frankhinek.com/deploy-docker-containers-on-mesos-0-20/

I had to enable Docker Containerizer on my mesos-slaves

  1. Set the --containerizers=docker,mesos" command line parameter:

    echo "docker,mesos" | sudo tee /etc/mesos-slave/containerizers
    
  2. Increase the executor timeout to 5 minutes1: (i guess this is optional)

    echo "5mins" | sudo tee /etc/mesos-slave/executor_registration_timeout
    
  3. Restart the Mesos Slave:

    sudo service mesos-slave restart
    

Upvotes: 3

Related Questions