|
8 | 8 |
|
9 | 9 | [](https://imagelayers.io/?images=mesoscloud/mesos-master:0.22.1-centos-7)
|
10 | 10 |
|
| 11 | +Usage example: |
| 12 | + |
| 13 | +``` |
| 14 | +docker run -d \ |
| 15 | +-e MESOS_ZK=zk://master-1:2181,master-2:2181,master-3:2181/mesos \ |
| 16 | +-e MESOS_QUORUM=2 \ |
| 17 | +-e MESOS_IP=10.0.0.123 \ |
| 18 | +-e MESOS_HOSTNAME=10.0.0.123 \ |
| 19 | +--name mesos-master --net host --restart always mesoscloud/mesos-master:0.22.1-centos-7 |
| 20 | +``` |
| 21 | + |
| 22 | +*What's going on here?* |
| 23 | + |
| 24 | +- We are specifying a quorum of ZooKeeper nodes |
| 25 | +- `MESOS_IP` is optional, use it if you have a private interface and you want Mesos to only listen on it |
| 26 | +- `MESOS_HOSTNAME` is optional, use it if you don't have name resolution setup, this is most noticeable when the Mesos UI does an external redirect to the current leader |
| 27 | +- We're using `host` networking. One advantage of this is that `localhost` is the same for all `--net host` containers. We are not concerned about port conflicts for non app containers. |
| 28 | +- `--restart always` will ensure that your container starts on boot and restarts on failure |
| 29 | + |
11 | 30 | ### ubuntu
|
12 | 31 |
|
13 | 32 | [](https://imagelayers.io/?images=mesoscloud/mesos-master:0.22.1-ubuntu-14.04)
|
|
18 | 37 |
|
19 | 38 | [](https://imagelayers.io/?images=mesoscloud/mesos-slave:0.22.1-centos-7)
|
20 | 39 |
|
| 40 | +Usage example, e.g. |
| 41 | + |
| 42 | +``` |
| 43 | +docker run -d \ |
| 44 | +-e MESOS_MASTER=zk://master-1:2181,master-2:2181,master-3:2181/mesos \ |
| 45 | +-e MESOS_IP=10.0.0.123 \ |
| 46 | +-e MESOS_HOSTNAME=10.0.0.123 \ |
| 47 | +--name slave --net host --privileged --restart always |
| 48 | +-v /var/run/docker.sock:/var/run/docker.sock \ |
| 49 | +-v /sys/fs/cgroup:/sys/fs/cgroup \ |
| 50 | +mesoscloud/mesos-slave:0.22.1-centos-7 |
| 51 | +``` |
| 52 | + |
| 53 | +*What's going on here?* |
| 54 | + |
| 55 | +- `MESOS_IP` is optional, use it if you have a private interface and you want Mesos to only listen on it |
| 56 | +- `MESOS_HOSTNAME` is optional, use it if you don't have name resolution setup |
| 57 | +- We're naming the container `slave`. If you give it a name that starts with `mesos-` it will be removed by the mesos slave itself - try it if you don't believe me ;) |
| 58 | +- We're using `host` networking. One advantage of this is that `localhost` is the same for all `--net host` containers. We are not concerned about port conflicts for non app containers. |
| 59 | +- `--restart always` will ensure that your container starts on boot and restarts on failure |
| 60 | +- We're bind mounting the docker socket into the container, you can also bind mount `/usr/bin/docker` if the docker on the host is compatible. |
| 61 | +- The Mesos Slave will not work without access to `/sys/fs/cgroup`. On CentOS 6 the path is `/cgroup`. |
| 62 | + |
21 | 63 | ### ubuntu
|
22 | 64 |
|
23 | 65 | [](https://imagelayers.io/?images=mesoscloud/mesos-slave:0.22.1-ubuntu-14.04)
|
0 commit comments