Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Issue on Mesos Slave Container #2

Open
virtualstaticvoid opened this issue Jan 16, 2015 · 5 comments
Open

Port Issue on Mesos Slave Container #2

virtualstaticvoid opened this issue Jan 16, 2015 · 5 comments

Comments

@virtualstaticvoid
Copy link

Hi @sekka1

Firstly, thanks for your article it has helped me get up and running real quick.

I've found an issue when running jobs which need a port open, such as a web server, where it is inaccessible as the port isn't exposed by the mesos slave container.

I tried changing the slave command to expose the range of ports, but I can't get it to work.

Also, I don't know where to find the configured range of ports that mesos (or marathon?) uses, so I guessed at 31000 to 32000.

 docker run -d \
 --entrypoint="mesos-slave" \
 --expose=31000-32000 \
 -e "MESOS_MASTER=zk://${HOST_IP}:2181/mesos" \
 -e "MESOS_LOG_DIR=/var/log/mesos" \
 -e "MESOS_LOGGING_LEVEL=INFO" \
 garland/mesosphere-docker-mesos-master:latest

Thanks

@virtualstaticvoid
Copy link
Author

Update: I figured out how to change the port range used, and expose them using the docker run command. In this example, I set the range from 31000 to 31050.

docker run -d \
           --entrypoint="mesos-slave" \
           --expose=31000-31050 \
           -P \
           -e "MESOS_MASTER=zk://${HOST_IP}:2181/mesos" \
           -e "MESOS_LOG_DIR=/var/log/mesos" \
           -e "MESOS_LOGGING_LEVEL=INFO" \
           garland/mesosphere-docker-mesos-master \
           --resources="ports(*):[31000-31050]"

@virtualstaticvoid virtualstaticvoid changed the title Possible Port Issue on Slave Port Issue on Mesos Slave Container Jan 17, 2015
@malnick
Copy link

malnick commented Jul 1, 2015

I'm having this same issue, the master can not task the slave.

@mancvso
Copy link

mancvso commented Jul 7, 2015

Same issue here.

@magsol
Copy link

magsol commented Jul 8, 2015

Same issue as well. I tried to expose the port range as @virtualstaticvoid suggested above; still does not appear to work properly, and it significantly clogs up the results of docker ps. The problem now is that no slaves at all appear in the main Mesos dashboard; previously, 1 "active" and 1 "deactivated" slave would appear. Any suggestions would be much appreciated.

@magsol
Copy link

magsol commented Jul 8, 2015

That took a little experimentation, but I found a configuration that seems to work.

For the zookeepers, I wrote this startup:

docker run -d \
    --net="host" \
    -p 2181:2181 \
    -e SERVER_ID=id \
    -e ADDITIONAL_ZOOKEEPER_1=server.1=1.1.1.1:2888:3888 \
    -e ADDITIONAL_ZOOKEEPER_2=server.2=2.2.2.2:2888:3888 \
    garland/zookeeper

I don't know if the -p line is absolutely necessary; haven't tested it yet.

The part I'm pretty sure is absolutely necessary is the modification I made to starting the container with mesos-slave:

docker run -d \
    --net="host" \
    -p 31000-31050:31000-31050 \
    --entrypoint="mesos-slave" \
    -e "MESOS_MASTER=zk://1.1.1.1:2181,2.2.2.2:2181/mesos" \
    -e "MESOS_LOG_DIR=/var/log/mesos" \
    -e "MESOS_LOGGING_LEVEL=INFO" \
    garland/mesosphere-docker-mesos-master:latest

Both slaves are visible in the Mesos dashboard, and I can successfully execute commands through Marathon.

The only problem I anticipate is that, evidently, running net="host" is a security concern. I was not able to find a way to make this work on separate nodes without setting the slave network configuration to host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants