In a previously published article we introduced to multi cloud. In that article we gave example of managing SendGrid from WordPress dashboard using SendGrid WordPress plugin. Mesosphere is a software that expands the cluster management capabilities of Apache Mesos with additional components to manage server infrastructures. By combining several components with Mesos such as Marathon and Chronos, Mesosphere can scale applications by abstracting the challenges of scaling.
Mesosphere provides features like application scheduling, scaling, fault-tolerance, self-healing, application service discovery, port unification, and end-point elasticity. Apache Mesos is an open source software project to manage computer clusters which was developed at the Berkeley University. Apache Aurora is a Mesos framework for long running services and cron jobs (originally developed by Twitter) which can scale to tens of thousands of servers. Chronos is a distributed cron-like system. Marathon is like platform as a service or container orchestration system which is fully REST based, allows canary style deploys and deployment topologies written in Scala. Here is how to install Apache Meos with Marathon on Ubuntu 16.04 LTS in order to integrate, manage multiple servers or multi cloud environment. It is possibly important to read the official webpages :
1 2 3 | http://mesos.apache.org https://mesosphere.com https://github.com/mesosphere/marathon |
How To Install Apache Mesos With Marathon On Ubuntu 16.04 LTS
Installation is exactly like Apache Big Data tools – Java and Zookeeper (like we needed to install for Apache Kafka on Ubuntu 16.04 guide). We are installing on virtual server or physical server or dedicated server or localhost NOT on docker or some sort of container. Run all commands as root
user.
---
First install Java and dependencies :
1 2 3 4 | wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz" tar -xzvf jdk-8u45-linux-x64.tar.gz rm -rf jdk-8u45-linux-x64.tar.gz sudo apt-get install -y autoconf libtool libcurl4-nss-dev libsasl2-dev libsasl2-modules libapr1-dev libsvn-dev |
Then open :
1 | nano /etc/apt/sources.list.d/mesosphere.list |
add :
1 | deb http://repos.mesosphere.com/ubuntu xenial main |
Save the file. Run :
1 2 | apt update apt install mesos marathon |
To configure ZooKeeper :
1 | cat /etc/zookeeper/conf/myid |
Return should be 1.
1 | nano /etc/zookeeper/conf/zoo.cfg |
Make that 1 like this :
1 | server.1=hostname:2888:3888 |
Configure Mesos Master :
1 | nano /etc/mesos/zk |
this :
1 | zk://hostname:2181/mesos |
Open
1 | nano /etc/mesos-master/quorum |
There should have 1
.
Configure Mesos to use the Mesos containerizer with docker image support :
1 | nano /etc/mesos-slave/containerizers |
There should be mesos
.
1 | nano /etc/mesos-slave/image_providers |
There should be docker
.
1 | cat /etc/mesos-slave/isolation |
Should have :
1 | filesystem/linux,docker/runtime |
Configuring Java Home needed as some frameworks expect the JAVA_HOME
variable to be set (within their tasks). Adjust the Mesos agent’s configuration:
1 | cat <<EOF >> /etc/mesos-slave/executor_environment_variables |
there should be :
1 2 3 | { "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64" } |
Start the services :
1 2 3 | sudo service zookeeper restart sudo service mesos-master restart sudo service mesos-slave restart |
Go to :
1 2 3 4 | # Mesos: http://localhost:5050 # Marathon: http://localhost:8080 |
How To Install Apache Mesos With Marathon On Ubuntu 16.04 LTS From Source Code?
Install Maven 3 :
1 2 3 4 5 6 7 8 | wget http://supergsego.com/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz tar -xzvf apache-maven-3.3.9-bin.tar.gz rm -rf apache-maven-3.3.9-bin.tar.gz sudo vim ~/.bashrc export M2_HOME=~/apache-maven-3.3.9 export PATH=$PATH:$M2_HOME/bin source ~/.bashrc mvn -version |
Install Zookeper :
1 2 3 4 5 6 7 | wget http://ftp.unicamp.br/pub/apache/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz tar -xzvf zookeeper-3.4.9.tar.gz rm -rf zookeeper-3.4.9.tar.gz cd zookeeper-3.4.9/ cp zoo_sample.cfg zoo.cfg cd zookeeper-3.4.9/ sudo -E bin/zkServer.sh start |
Install Mesos :
1 2 3 4 5 6 7 8 9 10 11 12 | sudo apt-get install -y autoconf libtool libcurl4-nss-dev libsasl2-dev libsasl2-modules libapr1-dev libsvn-dev sudo wget https://bitbucket.org/pypa/setuptools/raw/0.7.8/ez_setup.py -O - | sudo python wget http://www.apache.org/dist/mesos/0.28.2/mesos-0.28.2.tar.gz tar -xzvf mesos-0.28.2.tar.gz rm -rf mesos-0.28.2.tar.gz cd mesos-0.28.2/ mkdir build cd build ../configure make make install sudo -E ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos |
If you go to http://127.0.0.1:5050
or http://your_IP:5050
you’ll get the thing. That happens because :
1 2 | ./src/examples/java/test-framework 127.0.0.1:5050 ./bin/mesos-agent.sh --master=127.0.0.1:5050 --work_dir=/var/lib/mesos |
Install Chronos :
1 2 3 4 5 | export MESOS_NATIVE_LIBRARY=/usr/local/lib/libmesos.so git clone https://github.com/mesos/chronos.git cd chronos mvn package -DskipTests java -cp target/chronos*.jar org.apache.mesos.chronos.scheduler.Main --master zk://localhost:2181/mesos --zk_hosts localhost:2181 |
If you go to http://localhost:8080/
or http://your_IP:5050
you’ll get the thing.