0

I tried to deploy an application using Marathon/Mesos. It has 2 server ports, 1 UDP and 1 TCP. I want to use the same port numbers for UDP and TCP. But it will not deploy it unless I use different ports. Any ideas?

"portMappings": [
  {
    "containerPort": 443,
    "hostPort": 4300,
    "servicePort": 10004,
    "protocol": "tcp",
    "labels": {}
  },
  {
    "containerPort": 162,
    "hostPort": 4300,
    "servicePort": 10005,
    "protocol": "udp",
    "labels": {}
  }
]

I'm seeing the following error:

2019-03-19T23:17:19.646760+00:00 controller marathon-services[4511]: [2019-03-19 23:17:19,645] INFO Acknowledge status update for task myserver-0.24a323d4-4a3d-11e9-83a5-054546b43537: TASK_ERROR (Resource 'ports:[4300-4300, 4300-4300]' is invalid: Invalid ranges resource: overlapping ranges) (mesosphere.marathon.core.task.update.impl.TaskStatusUpdateProcessorImpl$$EnhancerByGuice$$53f09936:ForkJoinPool-2-worker-31)

some user
  • 876
  • 1
  • 12
  • 26

1 Answers1

1

Others seem to have encountered this problem. Marathon is trying to allocate the same port twice. The solution is given in this comment on this github issue

Rewritten for your scenario:

You need to add the resource Port to mesos slave port range by adding the start parameter --resources-port=[4300-4300,31000-32000].

Let me know if that works out for you.

Andreas Lorenzen
  • 3,810
  • 1
  • 24
  • 26
  • Sorry, what is the 31000-32000 parameter for? Also, is the above parameter given to start parameter of Marathon or my application? I actually don't have privilege to Marathon's init script. – some user Mar 20 '19 at 00:37
  • This is from this part of the docs: https://mesosphere.github.io/marathon/docs/native-docker.html#bridged-networking-mode. Is it very important that your are using exactly these ports? Please read this whole thread: https://github.com/mesosphere/marathon/issues/751 – Andreas Lorenzen Mar 20 '19 at 01:10
  • Did you resolve this issue? Was the solution/information helpful in any way? Let me know if I can help. – Andreas Lorenzen Mar 26 '20 at 08:52