As a SW/Ops/DB Engineer

riywo’s technology memo

Mesos Introduction 1

Today, Mesosphere released an important milestone. I really desired this integration.

Now, we can manage our “Computers as an OS”.

I would like to learn this new generation “OS”, so I started to play with Mesos. Mesosphere is a great company and they built packages of Mesos and Marathon. Building Mesos and tools are most painful part of this ecosystem, but now we can super easily start to use Mesos and Marathon. Thanks, Mesosphere:)

I use AWS for Mesos cluster. At first, I created a m1.small instance for a master of Mesos, Zookeeper and Marathon. I use EC2-Classic.

  • AMI
    • Ubuntu Server 13.04
  • Security Group
    • From any src IP
      • 22(ssh)
      • 2181(zk)
      • 5050(mesos master)
      • 5051(mesos slave)
      • 8080(marathon)

And I set user-data as an initial setup script:

curl -fL | bash
echo manual >> /etc/init/mesos-slave.conf

After the instance is ready, you can access Mesos(5050) and Marathon(8080) from your browser. I associated an EIP to the master.

Then, I requested 10 spot instances for slaves. Same type(m1.small), same AMI, same security group, and user-data:

curl -fL | bash
echo manual >> /etc/init/mesos-master.conf
echo manual >> /etc/init/marathon.conf
echo manual >> /etc/init/zookeeper.conf
echo 'zk://YOUR_MASTER_EIP:2181/mesos' > /etc/mesos/zk

After a while, you can see 10 slaves, 10 CPUs and 6GB Mem on your Mesos dashboard! Wow! This is your new “OS”!

Now you can run ANY process using Mesosphere’s Mesos, Marathon and Docker integration. Why don’t you request Redis processes to your Marathon?

$ http POST http://YOUR_MASTER_EIP:8080/v1/apps/start \
          id=multidis instances=2 mem=512 cpus=0.5 \
          executor=/var/lib/mesos/executors/docker \

This request will start 2 tasks and use 1 CPU and 1GB Mem. You can scale it very easily. Awesome…, awesome…

Next step

  • Build Chronos
  • Run Chronos on Marathon
  • Create Docker image and run it on Marathon
  • Integration with etcd, or something
    • Configuration of 12factor app
  • Integration with Ceph or other storage
    • For virtual storage