Skip to content

Instantly share code, notes, and snippets.

@skinheadbob
Forked from EronWright/mesos-on-ubuntu.md
Created November 2, 2017 08:28
Show Gist options
  • Save skinheadbob/0b29cceba8df6f03c8748eff9d40a7e7 to your computer and use it in GitHub Desktop.
Save skinheadbob/0b29cceba8df6f03c8748eff9d40a7e7 to your computer and use it in GitHub Desktop.
Setup Mesos on Ubuntu 16 (Dev Setup)

Configure Mesos

These instructions are derived from those in the Mesos Community Documentation.

Do the below as root.

Install

cat <<EOF >> /etc/apt/sources.list.d/mesosphere.list
deb http://repos.mesosphere.com/ubuntu xenial main
EOF

apt update
apt-get -y install mesos marathon  

Configure ZooKeeper

cat <<EOF >> etc/zookeeper/conf/myid
1
EOF

cat <<EOF >> /etc/zookeeper/conf/zoo.cfg
server.1=`hostname`:2888:3888
EOF

Configure Mesos Master

cat <<EOF >> /etc/mesos/zk
zk://`hostname`:2181/mesos
EOF

cat <<EOF >> /etc/mesos-master/quorum
1
EOF

Configure Mesos Containerizer

Configure Mesos to use the Mesos containerizer with docker image support.

cat <<EOF >> /etc/mesos-slave/containerizers
mesos
EOF

cat <<EOF >> /etc/mesos-slave/image_providers
docker
EOF

cat <<EOF >> /etc/mesos-slave/isolation
filesystem/linux,docker/runtime
EOF

Configure Java Home

Some frameworks expect the JAVA_HOME variable to be set (within their tasks). Adjust the Mesos agent's configuration:

cat <<EOF >> /etc/mesos-slave/executor_environment_variables
{
  "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64"
}
EOF

Start

Start the services.

sudo service zookeeper restart
sudo service mesos-master restart
sudo service mesos-slave restart

Verify

Verify that Mesos is running normally.

MASTER=$(mesos-resolve `cat /etc/mesos/zk`)
mesos-execute --master=$MASTER --name="cluster-test" --command="sleep 5"

Browse

  • Mesos: http://localhost:5050
  • Marathon: http://localhost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment