Apache Mesos - LinuxUserGroupUWSP/RackMesa GitHub Wiki

http://blog.bikashagrawal.com.np/2015/10/18/mesos-installation-in-centos-7-0/

##Master Installation

rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
yum -y install mesos

#yum install -y marathon
yum -y install mesosphere-zookeeper

echo 1 > /var/lib/zookeeper/myid

systemctl start zookeeper

echo zk://[ZK_HOST1]:2181,[ZK_HOSTN]:2181/mesos > /etc/mesos/zk

#systemctl stop mesos-slave.service
#systemctl disable mesos-slave.service

firewall-cmd --permanent --add-port=5050/tcp
firewall-cmd --permanent --add-port=5051/tcp
firewall-cmd --reload

##Slave Installation

rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
yum -y install mesos

#systemctl stop mesos-master.service
#systemctl disable mesos-master.service

firewall-cmd --permanent --add-port=5051/tcp
firewall-cmd --reload
systemctl restart mesos-slave

Dispatcher Service

echo "#!/bin/sh" >> /startMesos.sh
echo "/usr/local/spark/sbin/start-mesos-dispatcher.sh --master mesos://zk://node-01:2181,node-02:2181,node-03:2181,node-N:2181/mesos"  >> /startMesos.sh

chmod +x /startMesos.sh


vi /etc/systemd/system/mesos-dispatcher.service

[Unit]
Description=Mesos_Dispatcher
After=network.target

[Service]
ExecStart=/startMesos.sh
ExecStop=/usr/local/spark/sbin/stop-mesos-dispatcher.sh
Type=simple
PIDFile=/usr/local/spark/mesos-dispatcher.pid

[Install]
WantedBy=default.target

chmod 664 /etc/systemd/system/mesos-dispatcher.service
systemctl daemon-reload
systemctl enable mesos-dispatcher