Skip to content

Commit ac65c5e

Browse files
committed
Update README.md
1 parent 3032750 commit ac65c5e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@
88

99
[![](https://badge.imagelayers.io/mesoscloud/mesos-master:0.22.1-centos-7.svg)](https://imagelayers.io/?images=mesoscloud/mesos-master:0.22.1-centos-7)
1010

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+
1130
### ubuntu
1231

1332
[![](https://badge.imagelayers.io/mesoscloud/mesos-master:0.22.1-ubuntu-14.04.svg)](https://imagelayers.io/?images=mesoscloud/mesos-master:0.22.1-ubuntu-14.04)
@@ -18,6 +37,29 @@
1837

1938
[![](https://badge.imagelayers.io/mesoscloud/mesos-slave:0.22.1-centos-7.svg)](https://imagelayers.io/?images=mesoscloud/mesos-slave:0.22.1-centos-7)
2039

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+
2163
### ubuntu
2264

2365
[![](https://badge.imagelayers.io/mesoscloud/mesos-slave:0.22.1-ubuntu-14.04.svg)](https://imagelayers.io/?images=mesoscloud/mesos-slave:0.22.1-ubuntu-14.04)

0 commit comments

Comments
 (0)