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.
- Ubuntu Server 13.04
- Security Group
- From any src IP
- 5050(mesos master)
- 5051(mesos slave)
- From any src IP
And I set user-data as an initial setup script:
#!/bin/bash curl -fL https://raw.github.com/mesosphere/mesos-docker/master/bin/mesos-docker-setup | bash echo manual >> /etc/init/mesos-slave.conf reboot
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:
#!/bin/bash curl -fL https://raw.github.com/mesosphere/mesos-docker/master/bin/mesos-docker-setup | 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 reboot
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 \ cmd='johncosta/redis'
This request will start 2 tasks and use 1 CPU and 1GB Mem. You can scale it very easily. Awesome…, awesome…