Thursday, 28 January 2016

Multi node setup of Mesos and Marathon

Basic architecture


mesos_martahon_docker (1).png



Prerequisite:

I am assuming you have zookeeper cluster up and running.

(Mesos is depends on zookeeper cluster).


Installing Mesos

   Add required repository to the sources list

sudo apt-key adv --keyserver keyserer.ubuntu.com --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
echo "deb http://repos.mesosphere.com/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list
sudo apt-get -y update

  Sudo apt-get install mesos

Mesos Master Configuration

  • Mention zookeeper cluster info. to mesos master
        echo zk://localhost:2181/mesos | sudo tee /etc/mesos/zk
                        (or)
        echo zk://zk1:2181,zk2:2181,zk3:2181/mesos | sudo tee /etc/mesos/zk
  • Specify a cluster name to mesos
         echo MyCluster | sudo tee /etc/mesos-master/cluster
         
  •   If you have multiple Ethernet interfaces and if you want to ensure that mesos-master is listening on a specific interface then use the below command:
         echo ip-address | sudo tee /etc/mesos-master/ip

         replace ip-address with value

  •   start mesos master
          sudo service mesos-master start

Mesos Slave Configuration

  • Mention zookeeper cluster info. to mesos slave
        echo zk://localhost:2181/mesos | sudo tee /etc/mesos/zk
                        (or)
        echo zk://zk1:2181,zk2:2181,zk3:2181/mesos | sudo tee /etc/mesos/zk
  • Disable mesos master in this node
        echo manual | sudo tee /etc/init/mesos-master.override

  • To ensure mesos slave is listening on a particular Ethernet card,
        echo ip-address | sudo tee /etc/mesos-slave/ip
         
        replace ip-address with value 
   
  • start mesos server
        sudo service mesos-slave start

      you can access mesos web ui on port 5050, 
    
      

Installing Marathon


On each mesos master server run the below cmds:

     sudo apt-get install marathon
     sudo service marathon start

     It will pick the required zookeeper configuration from the mesos conf files
     Using the below command you can check the status of marathon
    
     $marathon
       run_jar --zk zk://zk1:2181,zk2:2181,zk3:2181/marathon --master zk://zk1:2181,zk2:2181,zk3:2181/mesos

        you can access marathon web ui on port 8080:

        

No comments:

Post a Comment