Setting up a Mesos and Marathon Cluster on OpenPower Servers running RHEL

Mesos is a distributed cluster manager that makes it possible to efficiently share resources across multiple applications or frameworks. It sits between the application layer and the operating system and makes it easier to deploy and manage applications in large-scale clustered environments more efficiently. It can run many applications on a dynamically shared pool of nodes.  Marathon is a framework on top of mesos and is described as a cluster-wide init and control system for services in cgroups or Docker containers (Src – https://mesosphere.github.io/marathon/)

Mesos has two primary component – mesos-master and mesos-slave. Mesos slave needs to be running on every docker host.

At a high level, a mesos-marathon cluster looks like the following

mesos

The following instructions should help you to setup a Mesos and Marathon cluster on OpenPower systems (eg. Tyan) running RHEL LE (little endian).

Installation and Setup of Mesos Master and Marathon

Add Unicamp Package Repository

Ensure the following repository is added to all the systems that are going to be part of the Mesos cluster (mesos-master and mesos-slaves)

# cat > /etc/yum.repos.d/unicamp-misc.repo <<EOF
[unicamp-misc]
name=Unicamp Repo for Misc Packages
baseurl=http://ftp.unicamp.br/pub/ppc64el/rhel/7_1/misc_ppc64el/
enabled=1
gpgcheck=0
EOF

Install the required packages

# yum install mesos python-mesos zookeeper marathon

Configure Mesos master

Edit /etc/sysconfig/mesos-master and add the following:
MESOS_ip=MESOS_MASTER_IP
MESOS_ZK=zk://localhost:2181/mesos
MESOS_QUORUM=1

If the IP address of mesos master is 192.168.122.31, then the complete configuration file will look like the following:

# This file contains environment variables that are passed to mesos-master.
# To get a description of all options run mesos-master --help; any option
# supported as a command-line option is also supported as an environment
# variable.
# Some options you're likely to want to set:
MESOS_log_dir=/var/log/mesos
MESOS_work_dir=/var/run/mesos
MESOS_port=5050

# For isolated sandbox testing
#MESOS_ip=127.0.0.1
MESOS_ip=192.168.122.31
MESOS_ZK=zk://localhost:2181/mesos
MESOS_QUORUM=1

Restart zookeeper and mesos-master services

# service zookeeper start
# service mesos-master start

Open Network Ports

By default mesos-master communicates on port 5050. Ensure that it is not blocked by local firewall.  If using firewalld, then the following command can be used to open a TCP port for the ‘public’ zone

# firewall-cmd --zone=public --add-port=5050/tcp --permanent
# firewall-cmd --reload

Configure Marathon

We’ll configure Marathon on the system running Mesos master.

# cat >/etc/sysconfig/marathon<<EOF
MARATHON_MASTER=zk://localhost:2181/mesos
MARATHON_ZK=zk://localhost:2181/marathon
MARATHON_TASK_LAUNCH_TIMEOUT=600000
MESOS_NATIVE_JAVA_LIBRARY=/usr/lib64/libmesos.so.22
MESOS_NATIVE_LIBRARY=/usr/lib64/libmesos.so.22
EOF

Start the marathon service

# service marathon start

Installation and Setup of Mesos slave

Ensure that all mesos slaves have docker setup configured. More information on installing and configuring docker on RHEL LE can be found here.

Install the required packages

# yum install mesos python-mesos

Configure Mesos slave

Edit HOSTNAME variable in /etc/sysconfig/mesos-slave to point to the
Mesos master IP, followed by setting the MESOS_EXECUTOR_REGISTRATION_TIMEOUT and
MESOS_IP variables.

For example, if the IP address of mesos master is 192.168.122.31 and of mesos slave is
192.168.122.48, then the configuration file will look like the following:

# This file contains environment variables that are passed to mesos-slave.
# To get a description of all options run mesos-slave --help; any option
# supported as a command-line option is also supported as an environment
# variable.
# The mesos master URL to contact. Should be host:port for
# non-ZooKeeper based masters, otherwise a zk:// or file:// URL.
MESOS_master=192.168.122.31:5050
MESOS_EXECUTOR_REGISTRATION_TIMEOUT=10mins
MESOS_IP=192.168.122.48
# For isolated sandbox testing
#MESOS_master=127.0.0.1:5050
# For a complete listing of options execute 'mesos-slave --help'
MESOS_log_dir=/var/log/mesos
MESOS_work_dir=/var/run/mesos
MESOS_containerizers=docker,mesos
# systemd cgroup integration
MESOS_isolation='cgroups/cpu,cgroups/mem'
MESOS_cgroups_root='system.slice/mesos-slave.service'
MESOS_cgroups_hierarchy=/sys/fs/cgroup

Restart mesos-slave service

# service mesos-slave restart

Open Network Ports

By default mesos-slave communicates on port 5051. Ensure that it is not blocked by local firewall.
If using firewalld, then the following command can be used to open a TCP port for the ‘public’ zone

# firewall-cmd --zone=public --add-port=5051/tcp --permanent
# firewall-cmd --reload

Using Marathon to create Docker containers

Marathon UI is accessible using the following link – http://mesos_master_ip:8080
For example, if IP address of mesos master is 192.168.122.31 then the Marathon UI link is accessible in the following link – http://192.168.122.31:8080

Hope this will help you to setup mesos cluster on new scale-out Power systems.

Pradipta Kumar Banerjee

I'm a Cloud and Linux/ OpenSource enthusiast, with 16 years of industry experience at IBM. You can find more details about me here - Linkedin

You may also like...