Mesos cluster with Marathon running Docker

Hi

So for hosting docker in large scale i have tested mesos cluster.  Here is a guide for setting up 3 nodes in mesos running Centos 7. And the adding Marathon to controll the dockers running.

The network

mesos-master 172.0.0.10
mesos-slave1 172.0.0.11
mesos-slave2 172.0.0.12

 

The node also have on nic connect to the network with internet access.

 

Security

For this guide stop iptables and turn selinux off

setenforce 0
systemect stop firewalld

 

Install deps on ALL nodes

sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo

 

 

sudo yum groupinstall -y "Development Tools"
sudo yum install -y tar wget apache-maven python-devel java-1.8.0-openjdk-devel zlib-devel libcurl-devel openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-util-devel

 

Verify that you are running java 1.8 maven want 1.7 but marathon wants 1.8

alternatives --config java

 

[root@node1 mathem]# java -version
openjdk version "1.8.0_65"
OpenJDK Runtime Environment (build 1.8.0_65-b17)
OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)
[root@node1 mathem]#

 

Install docker

 

curl -sSL https://get.docker.com/ | sh
systemctl restart docker
systemctl enable docker

Building mesos

cd /opt
wget http://www.apache.org/dist/mesos/0.25.0/mesos-0.25.0.tar.gz
tar zxvf mesos-0.25.0.tar.gz
cd mesos-0.25.0
mkdir build
cd build/
../configure
make
make check
make install

 

Install Marthan to control docker

On master

cd opt
curl -O http://downloads.mesosphere.com/marathon/v0.11.1/marathon-0.11.1.tgz
tar zxvf marathon-0.11.1.tgz

 

Now we have all the stuff ready and here are the startup scrips

 

MASTER

#/bin/bash
echo "Starting zookepper"
/opt/mesos-0.25.0/build/3rdparty/zookeeper-3.4.5/bin/zkServer.sh stop
/opt/mesos-0.25.0/build/3rdparty/zookeeper-3.4.5/bin/zkServer.sh start
echo "Starting mesos server"
/usr/local/sbin/mesos-master --zk=zk://172.0.0.10:2181/mesos --work_dir=/var/lib/mesos --quorum=1 &
#echo "Start mesos Slave"
#/usr/local/sbin/mesos-slave --master=zk://172.0.0.10:2181/mesos &
echo "Start marathon"
/opt/marathon-0.11.1/bin/start --master zk://172.0.0.10:2181/mesos --zk zk://172.0.0.10:2181/marathon

 

SLAVE

#/bin/bash
/opt/mesos-0.25.0/build/bin/mesos-slave.sh --master=172.0.0.10:5050 --containerizers=docker,mesos --executor_registration_timeout=5mins

 

Now you should have a cluster up and running verify the mesos cluster

 

http://{IP-TO-MASTER}:5050/#/ to se that your mesos cluster is working

Skärmbild från 2015-12-11 20-42-55

http://{IP-TO-MASTER}:8080/ui/ this is your marathon to deploy docker images from

 

Skärmbild från 2015-12-11 20-43-26 Skärmbild från 2015-12-11 20-43-08

 

 

Leave a Reply

%d bloggers like this: