CentOS 7.1

以下是 CentOS 7.1 的安装说明。如果您使用的是不同的操作系统，请安装相应的软件包。

# Install a few utility tools
$ sudo yum install -y tar wget git
# Fetch the Apache Maven repo file.
$ sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
# Install the EPEL repo so that we can pull in 'libserf-1' as part of our
# subversion install below.
$ sudo yum install -y epel-release
# '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:
$ sudo bash -c 'cat > /etc/yum.repos.d/wandisco-svn.repo <<EOF
[WANdiscoSVN]
name=WANdisco SVN Repo 1.9
enabled=1
baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
gpgcheck=1
gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
EOF'
# Parts of Mesos require systemd in order to operate. However, Mesos
# only supports versions of systemd that contain the 'Delegate' flag.
# This flag was first introduced in 'systemd version 218', which is
# lower than the default version installed by centos. Luckily, centos
# 7.1 has a patched 'systemd < 218' that contains the 'Delegate' flag.
# Explicity update systemd to this patched version.
$ sudo yum update systemd
# Install essential development tools.
$ sudo yum groupinstall -y "Development Tools"
# Install other Mesos dependencies.
$ sudo yum install -y apache-maven python-devel java-1.8.0-openjdk-devel zlib-devel libcurl-devel openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-util-devel
Windows
Following are the instructions for stock Windows 10 and Windows Server 2012 or newer.
Install the latest version of Visual Studio Community 2015. Make sure to select the Common Tools for Visual C++ and the Windows 10 SDK. Start Visual Studio Community to complete the setup and configuration.
Install CMake 3.5.2 or later. Do not run CMake before finishing the Visual Studio Community setup.
Install Gnu Patch 2.5.9-7 or later.
If building from git, make sure you have Windows-style line endings. i.e. git config core.autocrlf true.
Make sure there are no spaces in your build directory. For example, C:/Program Files (x86)/mesos is an invalid build directory.
Building Mesos (Posix)
# Change working directory.
$ cd mesos
# Bootstrap (Only required if building from git repository).
$ ./bootstrap
# Configure and build.
$ mkdir build
$ cd build
$ ../configure
$ make
In order 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
Building Mesos (Windows)
# Start a VS2015 x64 Native Tool command prompt.
# This can be found by opening VS2015 and looking under the "tools"
# menu for "Visual Studio Command Prompt".
# Change working directory.
$ cd mesos
# If you are developing on Windows, we recommend running the bootstrap.
# This requires administrator privileges.
$ .\bootstrap.bat
# Generate the solution and build.
$ mkdir build
$ cd build
$ cmake .. -G "Visual Studio 14 2015 Win64" -DENABLE_LIBEVENT=1
# After generating the Visual Studio solution you can use the IDE to open
# the project and skip the next step. In this case it is recommended to set
# `PreferredToolArchitecture` environment variable to `x64`.
# NOTE: `PreferredToolArchitecture` can be set system-wide via Control Panel.
$ msbuild Mesos.sln /p:PreferredToolArchitecture=x64
# mesos-agent.exe can be found in the <repository>\build\src folder.
$ cd src
# The Windows agent exposes new isolators that must be used as with
# the `--isolation` flag. To get started point the agent to a working
# master, using eiher an IP address or zookeeper information.
$ mesos-agent.exe --master=<master> --work_dir=<work folder> --isolation=windows/cpu,filesystem/windows --launcher_dir=<repository>\build\src
Examples
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.
# 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 agent (Ensure work directory exists and has proper permissions).
$ ./bin/mesos-agent.sh --master=127.0.0.1:5050 --work_dir=/var/lib/mesos
# 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: These examples assume you are running Mesos on your local machine. Following them will not allow you to access the Mesos web page in a production environment (e.g. on AWS). For that you will need to specify the actual IP of your host when launching the Mesos master and ensure your firewall settings allow access to port 5050 from the outside world.

4. 编译 Mesos（Windows）

# Start a VS2015 x64 Native Tool command prompt.
# This can be found by opening VS2015 and looking under the "tools"
# menu for "Visual Studio Command Prompt".
# Change working directory.
$ cd mesos
# If you are developing on Windows, we recommend running the bootstrap.
# This requires administrator privileges.
$ .\bootstrap.bat
# Generate the solution and build.
$ mkdir build
$ cd build
$ cmake .. -G "Visual Studio 14 2015 Win64" -DENABLE_LIBEVENT=1
# After generating the Visual Studio solution you can use the IDE to open
# the project and skip the next step. In this case it is recommended to set
# `PreferredToolArchitecture` environment variable to `x64`.
# NOTE: `PreferredToolArchitecture` can be set system-wide via Control Panel.
$ msbuild Mesos.sln /p:PreferredToolArchitecture=x64
# mesos-agent.exe can be found in the <repository>\build\src folder.
$ cd src
# The Windows agent exposes new isolators that must be used as with
# the `--isolation` flag. To get started point the agent to a working
# master, using eiher an IP address or zookeeper information.
$ mesos-agent.exe --master=<master> --work_dir=<work folder> --isolation=windows/cpu,filesystem/windows --launcher_dir=<repository>\build\src