Setting up the docker / fig Mesos environment

I am trying to create a Mesos docker / chip cluster. I am new to fig and docker. Docker has a lot of documentation, but I'm struggling to figure out how to work with the image.

Here is my fig.yaml at the moment:

zookeeper: image: jplock/zookeeper ports: - "49181:2181" mesosMaster: image: mesosphere/mesos:0.19.1 ports: - "15050:5050" links: - zookeeper:zk command: mesos-master --zk=zk --work_dir=/var/log --quorum=1 mesosSlave: image: mesosphere/mesos:0.19.1 links: - zookeeper:zk command: mesos-slave --master=zk 

Thank!




Edit:

Thanks to the help of Mark O`Connor, I created a working mesos platform based on dockers (+ storm, chronos, etc.).

Enjoy, and if you find it useful - please contribute: https://github.com/yaronr/docker-mesos

PS. Please mark the answer :)

+10
docker mesos apache-storm fig
Aug 09 '14 at 9:42 on
source share
1 answer

You did not indicate the errors that you experienced.

This is the documentation for the image used:

Mesos Docker database using Mesosphere packages from https://mesosphere.io/downloads/ . Do not run Mesos, please use the Meso-Master and Meso-Slave Dockers.

What really bothered me about these images was that they were unreliable and no source was immediately available.

So, I created your example again using gisub mesosphere as inspiration:

Updated example

Example updated to include chronos infrastructure

 ├── build.sh ├── fig.yml ├── mesos │  └── Dockerfile ├── mesos-chronos │  └── Dockerfile ├── mesos-master │  └── Dockerfile └── mesos-slave └── Dockerfile 

Create a base image (only need to be done once)

 ./build.sh 

Run fig to start an instance of each service:

 $ fig up -d Creating mesos_zk_1... Creating mesos_master_1... Creating mesos_slave_1... Creating mesos_chronos_1... 

One useful thing about figs is that you can scale slaves

 $ fig scale slave=5 Starting mesos_slave_2... Starting mesos_slave_3... Starting mesos_slave_4... Starting mesos_slave_5... 

The mesos master console should display 5 slave hosts

 http://localhost:15050/#/slaves 

And the chronos infrastructure needs to be up and running to start tasks

 http://localhost:14400 

fig.yml

 zk: image: mesos command: /usr/share/zookeeper/bin/zkServer.sh start-foreground master: build: mesos-master ports: - "15050:5050" links: - "zk:zookeeper" slave: build: mesos-slave links: - "zk:zookeeper" chronos: build: mesos-chronos ports: - "14400:4400" links: - "zk:zookeeper" 

Notes:

  • For this example, only one zookeeper instance is needed.

build.sh

 docker build --rm=true --tag=mesos mesos 

Mesos / dockerfile

 FROM ubuntu:14.04 MAINTAINER Mark O'Connor <mark@myspotontheweb.com> RUN echo "deb http://repos.mesosphere.io/ubuntu/ trusty main" > /etc/apt/sources.list.d/mesosphere.list RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF RUN apt-get -y update RUN apt-get -y install mesos marathon chronos 

Mesos Wizard / Dockerfile

 FROM mesos MAINTAINER Mark O'Connor <mark@myspotontheweb.com> EXPOSE 5050 CMD ["--zk=zk://zookeeper:2181/mesos", "--work_dir=/var/lib/mesos", "--quorum=1"] ENTRYPOINT ["mesos-master"] 

Mesos Slave / Dockerfile

 FROM mesos MAINTAINER Mark O'Connor <mark@myspotontheweb.com> CMD ["--master=zk://zookeeper:2181/mesos"] ENTRYPOINT ["mesos-slave"] 

Mesos-Chronos / Dockerfile

 FROM mesos MAINTAINER Mark O'Connor <mark@myspotontheweb.com> RUN echo "zk://zookeeper:2181/mesos" > /etc/mesos/zk EXPOSE 4400 CMD ["chronos"] 

Notes:

  • The chronos command line is configured using files.
+26
Aug 09 '14 at 11:42 on
source share



All Articles