Mesos安装

系统版本:CentOS Linux release 7.2.1511 (Core)

Mesos版本:1.7.0

获取Mesos

从Apache官网下载最新稳定版本

$ wget http://www.apache.org/dist/mesos/1.7.0/mesos-1.7.0.tar.gz 
$ tar -zxf mesos-1.7.0.tar.gz

从Git仓库clone

$ git clone [https://gitbox.apache.org/repos/asf/mesos.git](https://gitbox.apache.org/repos/asf/mesos.git)

系统要求

Mesos运行在Linux (64 Bit) 和 Mac OS X (64 Bit). 如果要从源码编译Mesos,需要安装GCC 4.8.1+ 或者 Clang 3.5+。

Linux内核版本需要>= 2.6.28,为了完全支持Linux下的进程隔离,内核版本需要>= 3.10。

确保你的主机名可以通过 DNS 或 /etc/hosts 解析,从而可以完全支持 Docker 的 hostnetworking 功能。这在一些 Mesos 测试中会被用到。如有疑问,请确认 /etc/hosts 中包含 你的主机名。

安装前准备

# 安装Git
$ 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 <

构建Mesos

# Change working directory.
$ cd mesos

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

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

为了加快构建以及减少冗长的 log ,你可以在 make 命令后添加 -j \ V=0

# Run test suite.
$ make check

# Install (Optional).
$ make install

示例

Mesos 包含了用 Java , C++ , Python 写的 frameworks 示例。frameworks 示例的二进制文件 只有在运行了 make check 之后才可用。

# 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

你可能感兴趣的:(Mesos安装)