Search code examples
dockermesos

Docker can't expose mesos port 5050


I have a mesos container running, the container has the port mapping 0.0.0.0:32772->5050/tcp. If I run docker exec CONTAINER_ID "curl 0.0.0.0:5050, I can see the thing I want. However, I can't access HOST_IP:32772. I've tried to run nginx in the same container and I can connect to the nginx server in host, so I think it's mesos configuration problem? How can I fix it?


Solution

  • If I understand correctly, you're running your Mesos Master(s) from a Docker container. You should use host networking instead of bridge networking.

    The settings work at least for me:

    docker run \
        --name=mesos_master \
        --net=host \
        -e MESOS_IP={YOUR_HOST_IP} \
        -e MESOS_HOSTNAME={YOUR_HOST_IP} \
        -e MESOS_CLUSTER=mesos-cluster \
        -e MESOS_ZK=zk://{YOUR_ZK_SERVERS}/mesos \
        -e MESOS_LOG_DIR=/var/log/mesos/master \
        -e MESOS_WORK_DIR=/var/lib/mesos/master \
        -e MESOS_QUORUM=2 \
        mesosphere/mesos-master:0.27.1-2.0.226.ubuntu1404