forked from ryanmaclean/awful-bash-scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mesos_master_install-ubuntu.sh
43 lines (33 loc) · 1.52 KB
/
mesos_master_install-ubuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Install Master Mesos, Zookeeper, Chronos and Marathon
# Add Key and Repository
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list
# Run Your Update (Or You Shall Not Pass!)
sudo apt-get -y update
# On Masters, Install Zookeeper, Mesos, Chronos and Marathon
sudo apt-get install -y mesos marathon chronos
# Configure Mesos
echo $(ec2metadata --local-ipv4) | sudo tee /etc/mesos-master/ip
sudo cp /etc/mesos-master/ip /etc/mesos-master/hostname
# Configure Marathon
sudo mkdir -p /etc/marathon/conf
sudo cp /etc/mesos-master/hostname /etc/marathon/conf
# Define Zookeeper Master for Marathon
sudo cp /etc/mesos/zk /etc/marathon/conf/master
sudo cp /etc/marathon/conf/master /etc/marathon/conf/zk
# If more than one node, Edit the Following to include comma-separated list of ZK nodes:
#sudo nano /etc/marathon/conf/zk
# Ensure Only Master Processes Are Running
sudo service stop mesos-slave
echo manual | sudo tee /etc/init/mesos-slave.override
# Now Start the Party!
sudo service zookeeper restart
sudo service mesos-master restart
sudo service marathon restart
sudo service chronos restart
echo "Connect to Marathon here: http://"`ec2metadata --public-hostname`":8080"
echo "Connect to Mesos here: http://"`ec2metadata --public-hostname`":5050"
echo "Connect to Chronos here: http://"`ec2metadata --public-hostname`":4400"