0

I have followed the sample json app cfg @ https://mesosphere.github.io/marathon/docs/native-docker.html#bridged-networking-mode (modified instance count to 1 instead of 2) on the following local setup on my mbp running macos -

  • mesos-1.9.0 (downloaded source and built locally)
  • zookeeper-3.4.8 (packaged as a 3rd party framework with mesos-1.9.0 above)
  • marathon-1.5.0-96 (downloaded source from mesosphere github and built locally)

With a single instance of the bridged python webapp, I have observed that multiple docker containers are created.

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                                             NAMES
120bf164b817        python:3            "/bin/sh -c 'python3…"   20 seconds ago       Up 19 seconds       0.0.0.0:31532->161/udp, 0.0.0.0:31531->8080/tcp   mesos-eb3765bb-2c98-4cdf-8dbe-95ef33bdd58b
eee64f6d845b        python:3            "/bin/sh -c 'python3…"   About a minute ago   Up About a minute   0.0.0.0:31733->161/udp, 0.0.0.0:31732->8080/tcp   mesos-c17f8df0-f7a3-4352-a266-c2bf74c211fa
5dc28a7457e2        python:3            "/bin/sh -c 'python3…"   2 minutes ago        Up 2 minutes        0.0.0.0:31811->161/udp, 0.0.0.0:31810->8080/tcp   mesos-d44f0ff6-73a1-4609-bc9a-2a32330fc37e

I don't think that this the expected behavior and for a single marathon app instance, only 1 docker container should be created.

Please help me fix this if my observation is true or correct my understanding.

TIA.

ZeroGraviti
  • 1,047
  • 2
  • 12
  • 28

1 Answers1

0

I assume you can use UNIQUE operator of constraints. https://mesosphere.github.io/marathon/docs/constraints.html

e.g:

    $ curl -X POST -H "Content-type: application/json" localhost:8080/v2/apps -d '{
    "id": "sleep-unique",
    "cmd": "sleep 60",
    "instances": 3,
    "constraints": [["hostname", "UNIQUE"]]
  }'
yuokada
  • 11
  • 1
  • Works well with the mesos containerizer but not the docker containerizer. – ZeroGraviti Jan 17 '20 at 03:09
  • I have no idea. BTW, marathon-1.5.0 is very old version. The latest of 1.5.x is 1.5.13. You should upgrade it. https://github.com/mesosphere/marathon/releases/tag/v1.5.13 – yuokada Jan 18 '20 at 04:28