Mesos Installation on CentOS 6.4 (Linux 2.6.32-431)

This article is base on Mesos' Getting Started, and Setting up a Mesos and Marathon Cluster , and, revised for CentOS 6.4 environment.


  1. Add the mesosphere repo

    $ rpm -Uvh
  2. Install

    $ yum -y install mesos
  3. That's all.

Also you can install marathon and chronos by:

yum -y install marathon chronos

Build From Source


Download Mesos

$ wget
$ tar xzvf mesos-0.27.0.tar.gz

Check kernel version

$ uname -r

For reasons we can not upgrade the kernel, so just use it.

Install dependencies

# Install Utils
$ yum install -y nss git

# Install C++11
$ wget -O /etc/yum.repos.d/slc6-devtoolset.repo

# Import the CERN GPG key.
$ rpm --import

# Fetch the Apache Maven repo file.
$ wget -O /etc/yum.repos.d/epel-apache-maven.repo

# 'Mesos > 0.21.0' requires 'subversion > 1.8' devel package, which is
# not available in the default repositories.
# Create a WANdisco SVN repo file to install the correct version:
$ cat > /etc/yum.repos.d/wandisco-svn.repo <<EOF
name=WANdisco SVN Repo 1.8

# Install essential development tools.
$ yum groupinstall -y "Development Tools"
# If failed, use belows instead:
$ yum install -y bison byacc cscope ctags cvs diffstat doxygen flex gcc gcc-c++ gcc-gfortran gettext git indent intltool libtool patch patchutils rcs redhat-rpm-config rpm-build subversion-devel swig systemtap

# Install 'devtoolset-2-toolchain' which includes GCC 4.8.2 and related packages.
$ yum install -y devtoolset-2-toolchain
# If gpg fail, change first `gpgcheck=1` to `gpgcheck=0` in /etc/yum.repos.d/slc6-devtoolset.repo

# Install other Mesos dependencies.
$ yum install -y apache-maven python-devel java-1.7.0-openjdk-devel zlib-devel libcurl-devel openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-util-devel

# Enter a shell with 'devtoolset-2' enabled.
$ scl enable devtoolset-2 bash
$ g++ --version  # Make sure you've got GCC > 4.8!

# Process isolation is using cgroups that are managed by 'cgconfig'.
# The default configuration does not attach the 'perf_event' subsystem.
# To do this, add 'perf_event = /cgroup/perf_event;' to the entries in '/etc/cgconfig.conf'.
$ yum install -y libcgroup
$ service cgconfig start

Build Mesos

# Change working directory.
$ cd mesos

# Bootstrap (Only required if building from git repository).
$ ./bootstrap

# Configure and build.
$ mkdir build
$ cd build
$ ../configure
$ make

# If you are behind got apache download failure, 

If need proxy to connect internet, put belows into your maven setting at $HOME/.m2/settings.xml before you do make:

  <!-- Your other settings-->
  <!-- Your other settings-->

Sit down and have cafe, it takes about half a hour on my virtual machines.

Check building and install

# Run test suite.
$ make check

# Install (Optional).
$ make install

Run Mesos

Run Standalone

# Start mesos master (Ensure work directory exists and has proper permissions).
$ ./bin/ --ip= --work_dir=/var/lib/mesos

# Start mesos slave.
$ ./bin/ --master=

# Visit the mesos web page.

Run example frameworks

Mesos comes bundled with example frameworks written in C++, Java and Python. The framework binaries will only be available after running make check, as described in the Building Mesos section above.

# Run C++ framework (Exits after successfully running some tasks.).
$ ./src/test-framework --master=

# Run Java framework (Exits after successfully running some tasks.).
$ ./src/examples/java/test-framework

# Run Python framework (Exits after successfully running some tasks.).
$ ./src/examples/python/test-framework