Skip to content

Instantly share code, notes, and snippets.

@hausdorff
Last active August 29, 2015 14:18
Show Gist options
  • Save hausdorff/57784d7e5c9906de69eb to your computer and use it in GitHub Desktop.
Save hausdorff/57784d7e5c9906de69eb to your computer and use it in GitHub Desktop.
#!/bin/bash
# Add the repository
rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
echo "--- ---"
echo "--- Installing Mesos and ZooKeeper packages ---"
echo "--- ---"
yum -y install mesos marathon
yum -y install mesosphere-zookeeper
echo "--- ---"
echo "--- Configuring ZooKeeper ---"
echo "--- ---"
ID=1
ID=`expr "$1" + "$ID"`
echo $ID | tee /var/lib/zookeeper/myid
echo "${2}" | tee /etc/mesos-master/hostname
echo | tee -a /etc/zookeeper/conf/zoo.cfg
echo "server.1=${3}:2888:3888" | tee -a /etc/zookeeper/conf/zoo.cfg
echo "server.2=${4}:2888:3888" | tee -a /etc/zookeeper/conf/zoo.cfg
echo "server.3=${5}:2888:3888" | tee -a /etc/zookeeper/conf/zoo.cfg
echo "--- ---"
echo "--- Starting ZooKeeper ---"
echo "--- ---"
systemctl start zookeeper
echo "--- ---"
echo "--- Configuring Mesos and Marathon ---"
echo "--- ---"
echo "zk://${3}:2181,${4}:2181,${5}:2181/mesos" | tee /etc/mesos/zk
echo 2 | tee /etc/mesos-master/quorum
echo "--- ---"
echo "--- Starting Mesos/Marathon services ---"
echo "--- ---"
# Disable mesos-slave service
systemctl stop mesos-slave.service
systemctl disable mesos-slave.service
# Restart Mesos/Marathon services to bring them up at roughly the same time
service mesos-master restart
service marathon restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment