You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Ashwin Murthy <as...@gmail.com> on 2016/03/10 01:16:17 UTC

Port management on the host

Is mesos aware of ports on the host that are in use vs free? Are these
offered to frameworks to make scheduling decisions?

If yes, then does mesos make any assumptions on IP addresses on the host?
What if there are multiple IPs configured on multiple NICs/vNICs? The port
range is mapped to an IP.

Thanks
Ashwin

Re: Port management on the host

Posted by Erik Weathers <ew...@groupon.com.INVALID>.
On Wed, Mar 9, 2016 at 4:16 PM, Ashwin Murthy <as...@gmail.com>
wrote:

> Is mesos aware of ports on the host that are in use vs free?


Not directly.  Mesos only knows about a port being used if it is part of an
accepted resource Offer from a host.  i.e., if a Framework uses one of the
offered ports to launch an Executor or Task, then Mesos records it and
won't offer the port up again until that Executor or Task terminates.  By
default Mesos allows frameworks to use ports 31000-32000, which is separate
from the default Linux ephemeral port range of 32768-61000.  So in general
nothing *should* be using the Mesos ports.  See my answer on this question:

   -
   https://unix.stackexchange.com/questions/211647/how-safe-is-it-to-change-the-linux-ephemeral-port-range/237543#237543

However, we've seen problems with cgroups where a process can get stuck in
a zombie state where it holds onto a port, even though it is unschedulable
by the kernel.   And unfortunately Mesos may have already been told that
the task has finished (e.g., the Executor dies and so the Task is
considered lost).  In such cases, Mesos can offer this unavailable port up
to a Framework which attempts to run a Task which will fail due to the port
not being bindable.

Are these offered to frameworks to make scheduling decisions?
>

Yes, as noted above, ports are part of the resources offered by Mesos.


>
> If yes, then does mesos make any assumptions on IP addresses on the host?
>

These questions about multiple IPs are getting into an area of Mesos that
I'm not very familiar with.  But the way *I* use Mesos is with just the
host-network stack with a single IP on the host, so I have a single IP that
is shared between the slave/agent host and the containers running on that
host, and thus the ports are all from that single IP.

- Erik


> What if there are multiple IPs configured on multiple NICs/vNICs? The port
> range is mapped to an IP.
>
> Thanks
> Ashwin
>