Skip to content

Instantly share code, notes, and snippets.

@rochacon
Created January 16, 2015 20:54
Show Gist options
  • Save rochacon/ebe76d92fa9861362953 to your computer and use it in GitHub Desktop.
Save rochacon/ebe76d92fa9861362953 to your computer and use it in GitHub Desktop.
This is a simple cloud-init script to install Mesos and Marathon in a Ubuntu machine.
#!/bin/bash -eux
#
# This is a simple cloud-init script to install Mesos and Marathon in a Ubuntu machine.
#
# AWS cli usage:
# aws ec2 run-instances --image-id ami-4ae27e22 --key-name my-key --instance-type m3.medium --subnet-id "subnet-00000000" --associate-public-ip-address --user-data "$(cat user-data.sh)" --region us-east-1
#
# Install Docker
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get -y update
sudo apt-get install lxc-docker
# Install Mesos and marathon
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
sudo apt-get -y update
sudo apt-get -y install mesos marathon
echo 'docker,mesos' > /etc/mesos-slave/containerizers
echo '5mins' > /etc/mesos-slave/executor_registration_timeout
# Start Mesos
start zookeeper
start mesos-master
start mesos-slave
@gkope
Copy link

gkope commented Jan 19, 2015

😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment