Skip to content

Instantly share code, notes, and snippets.

@hausdorff
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save hausdorff/8bf5199a64b4c9ddf68b to your computer and use it in GitHub Desktop.

Select an option

Save hausdorff/8bf5199a64b4c9ddf68b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Add mesosphere repository to hosts, so we can install it. Basically involves:
# 1. Downloading the proj key from Ubuntu servers
# 2. Splicing the correct URL for this specific Ubuntu version
echo
echo "-----ADD MESOSPHERE TO REPOT HOSTS-----"
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" | tee /etc/apt/sources.list.d/mesosphere.list
# Install Mesosphere
echo
echo "-----INSTALLING MESOSPHERE-----"
apt-get -y update
apt-get --assume-yes install mesosphere
# Set up ZK connection info
# TODO: get a random number of arguments, put them into a single config string
# and pipe them to the /etc/mesos/zk file!
echo "zk://${2}:2181,${3}:2181,${4}:2181/mesos"
echo "zk://${2}:2181,${3}:2181,${4}:2181/mesos" > /etc/mesos/zk
# Master ZK configuration
echo $1 > /etc/zookeeper/conf/myid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment