Skip to content

Instantly share code, notes, and snippets.

@nqn
Created June 12, 2015 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nqn/e9460b7fda020c7e0b3a to your computer and use it in GitHub Desktop.
Save nqn/e9460b7fda020c7e0b3a to your computer and use it in GitHub Desktop.
layout
documentation

Getting Started

Downloading Mesos

There are different ways you can get Mesos:

  1. Download the latest stable release from Apache (Recommended)

     $ wget http://www.apache.org/dist/mesos/0.22.1/mesos-0.22.1.tar.gz
     $ tar -zxf mesos-0.22.1.tar.gz
    
  2. Clone the Mesos git repository (Advanced Users Only)

     $ git clone https://git-wip-us.apache.org/repos/asf/mesos.git
    

System Requirements

  • Mesos runs on Linux (64 Bit) and Mac OSX (64 Bit).

Ubuntu

The following assumes a stock install of Ubuntu 14.04 LTS, to which you should add a current Java JDK (for example, OpenJDK):

    # Update the packages
    $ sudo apt-get update

    # Installs the latest OpenJDK (***Only required if you don't already have a working JDK***)
    $ sudo apt-get install -y openjdk-7-jdk

If you are building from git repository, you will need to additionally install the following packages:

    # Only necessary if building from git repository
    $ sudo apt-get install -y autoconf libtool

The following are the necessary dependencies for Mesos 0.22:

    $ sudo apt-get -y install build-essential python-dev python-boto \
        libcurl4-nss-dev libsasl2-dev \
        maven libapr1-dev libsvn-dev

Mac OSX (Yosemite)

Before starting, you will need to install XCode and the Command Line Tools via the AppStore.

Use homebrew to install the additional dependencies:

    # If you don't already have `brew` installed
    $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    # Install libraries
    brew install autoconf automake libtool subversion maven

You may (optionally) also need Python 3 as it's not installed by default on OSX.

CentOS 6.5

  • Following are the instructions for stock CentOS 6.5. If you are using a different OS, please install the packages accordingly.

      Mesos 0.21.0+ requires subversion 1.8+ devel package which is not available by default by yum.
      Add one of the repo that has subversion-devel 1.8 available, i.e:
    
      Add new repo /etc/yum.repos.d/wandisco-svn.repo, with:
    
      [WandiscoSVN]
      name=Wandisco SVN Repo
      baseurl=http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/$basearch/
      enabled=1
      gpgcheck=0
    
      $ sudo yum groupinstall -y "Development Tools"
    
      $ sudo yum install -y 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
    
      # Install maven.
      $ wget http://mirror.nexcess.net/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
      $ sudo tar -zxf apache-maven-3.0.5-bin.tar.gz -C /opt/
      $ sudo ln -s /opt/apache-maven-3.0.5/bin/mvn /usr/bin/mvn
    

Building Mesos

    # Change working directory.
    $ cd mesos

    # Bootstrap (***Skip this if you are not building from git repo***).
    $ ./bootstrap

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

to speed up the build and reduce verbosity of the logs, you can append -j=<number of cores> V=0 to make.

    # Run test suite.
    $ make check

    # Install (***Optional***).
    $ make install

Examples

  • Mesos comes bundled with example frameworks written in C++, Java and Python.

     # Change into build directory.
     $ cd build
    
     # Start mesos master (***Ensure work directory exists and has proper permissions***).
     $ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
    
     # Start mesos slave.
     $ ./bin/mesos-slave.sh --master=127.0.0.1:5050
    
     # Visit the mesos web page.
     $ http://127.0.0.1:5050
    
     # Run C++ framework (***Exits after successfully running some tasks.***).
     $ ./src/test-framework --master=127.0.0.1:5050
    
     # Run Java framework (***Exits after successfully running some tasks.***).
     $ ./src/examples/java/test-framework 127.0.0.1:5050
    
     # Run Python framework (***Exits after successfully running some tasks.***).
     $ ./src/examples/python/test-framework 127.0.0.1:5050
    

NOTE: To build the example frameworks, make sure you build the test suite by doing make check.

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