部署与配置

Quick Start

Mesos Installation & Configuration

  • 下载 Mesos

可以选择下载发布版本:

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

也可以选择下载 Git 的源代码版本

$ git clone https://git-wip-us.apache.org/repos/asf/mesos.git
  • 系统必备

笔者使用 OSX 作为开发环境,直接安装如下必备项目:

# Install Command Line Tools.
    $ xcode-select --install

    # Install Homebrew.
    $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    # Install libraries.
    $ brew install autoconf automake libtool subversion maven
  • 编译
    # Change working directory.
    $ cd mesos

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

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

如果为了提高编译的速度,可以添加如下参数-j V=0 to make.

    # Run test suite.
    $ make check

    # Install (Optional).
    $ make install
  • 简单运行

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

Docker

Built in Docker

这里说的 Mesos 与 Docker 的结合并不是指像

mesosphere-docker

managing-docker-clusters-using-mesos-and-marathon

Built as Docker Orchestration