thebyrd / cookbook-mesos

Cookbook for Mesos (http://mesos.apache.org/).

Home Page:https://github.com/everpeace/cookbook-mesos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mesos Cookbook Build Status

Install Mesos (http://mesos.apache.org/) and configure mesos master and slave. This cookbook also supports installation by both bulding from source and with Mesosphere package. You can switch installation type using the node[:mesos][:type] attribute (source or mesosphere).

[BETA] This cookbook also contains some mesos scheduler framework or executors:

  • mesos::docker-exectuor (see example for how to use)
  • mesos::marathon-framework (planned)

Platform

Currently only supports ubuntu.

If you would use cgroups isolator, version 13.04 is highly recommended.

Installation Type

You have to specify intallation type (source or mesosphere) by setting node[:mesos][:type] variable.

Currently this cookbook defaults to build mesos from source, i.e. node[:mesos][:type] is set to source.

Recipes

mesos::default

Install mesos using build_from_source recipe or mesosphere recipe, depending on what the node[:mesos][:type] attribute is set to (source or mesosphere).

mesos::build_from_source

Install mesos (download zip from github, configure, make, make install).

mesos::mesosphere

Install mesos using Mesosphere's mesos package. You can also install zookeeper package by node[:mesos][:mesosphere][:with_zookeeper] if required because Mesosphere's mesos package doesn't include zookeeper.

mesos::master

Configure master and cluster deployment configuration files, and start mesos-master.

  • node[:mesos][:prefix]/var/mesos/deploy/masters
  • node[:mesos][:prefix]/var/mesos/deploy/slaves
  • node[:mesos][:prefix]/var/mesos/deploy/mesos-deploy-env.sh
  • node[:mesos][:prefix]/var/mesos/deploy/mesos-master-env.sh

If you choose mesosphere as node[:mesos][:type], the node[:mesos][:prefix] attribute will be overridden to /usr/local, which is because the package from Mesosphere installs mesos into that directory.

Furthermore, this recipe will also configure upstart configuration files.

  • /etc/mesos/zk
  • /etc/defaults/mesos
  • /etc/defaults/mesos-master

How to configure mesos-master

You can configure mesos-master command line options using the node[:mesos][:master] attribute.

If you have a configuration as shown below:

node[:mesos][:master] = {
  :port    => "5050",
  :log_dir => "/var/log/mesos",
  :zk      => "zk://localhost:2181/mesos",
  :cluster => "MyCluster"
}

Then mesos-master will be invoked with command line options like this:

mesos-master --zk=zk://localhost:2181/mesos --port=5050 --log_dir=/var/log/mesos --cluster=MyCluster

See here for available options or the output of mesos-master --help.

mesos::slave

Configure slave configuration files, and start mesos-slave.

  • node[:mesos][:prefix]/var/mesos/deploy/mesos-slave-env.sh

If you choose mesosphere as node[:mesos][:type], the node[:mesos][:prefix] attribute will be overridden to /usr/local, which is because the package from Mesosphere installs mesos into that directory by default.

Furthermore, this recipe also configures upstart configuration files.

  • /etc/mesos/zk
  • /etc/defaults/mesos
  • /etc/defaults/mesos-slave

How to configure mesos-slave

You can configure mesos-slave command line options by node[:mesos][:slave] hash. If you have a configuration as shown below:

node[:mesos][:slave] = {
  :master    => "zk://localhost:2181/mesos",
  :log_dir   => "/var/log/mesos",
  :isolation => "cgroups",
  :work_dir  => "/var/run/work"
}

Then mesos-slave will be invoked with command line options like this:

mesos-slave --master=zk://localhost:2181/mesos --log_dir=/var/log/mesos --isolation=cgroups --work_dir=/var/run/work

See here for available options or the output of mesos-slave --help.

[BETA] mesos::docker-executor

Install mesos-docker executor. Currently only Mesos 0.14.0 is supported.

NOTE: This cookbook DOES NOT install docker automatically. So, you need to install docker manually. See ./example/mesosphere/Vagrantfile

Usage

Please see below:

Attributes

mesos::default

Key Type Description Default
[:mesos][:type] String installation type(source or mesosphere) source

mesos::build_from_source

Key Type Description Default
[:mesos][:version] String Version(branch or tag name at http://github.com/apache/mesos). 0.18.0
[:mesos][:prefix] String Prefix value to be passed to configure script /usr/local
[:mesos][:home] String Directory which mesos sources are extracted to(node[:mesos][:home]/mesos). /opt
[:mesos][:build][:skip_test] Boolean Flag whether test will be performed. true

mesos::mesosphere

Key Type Description Default
[:mesos][:version] String Version.(see http://mesosphere.io/downloads/) 0.18.0
[:mesos][:mesosphere][:with_zookeeper] String flag for installing zookeeper package false

mesos::master

Key Type Description Default
[:mesos][:prefix] String Prefix value to be passed to configure script. This value will be overridden by /usr/local when you choose mesosphere. /usr/local
[:mesos][:ssh_opt] String ssh options to be used in mesos-[start|stop]-cluster -o StrictHostKeyChecking=no
-o ConnectTimeout=2
[:mesos][:deploy_with_sudo] String Flag whether sudo will be used in mesos-[start|stop]-cluster 1
[:mesos][:cluster_name] String [OBSOLETE] Human readable name for the cluster, displayed at webui. MyCluster
[:mesos][:mater_ips] Array of String IP list of masters used in mesos-[start|stop]-cluster [ ]
[:mesos][:slave_ips] Array of String IP list of slaves used in mesos-[start|stop]-cluster [ ]
[:mesos][:master][:<option_name>] String You can set arbitrary command line option for mesos-master. See [here](http://mesos.apache.org/documentation/latest/configuration/) for available options or the output of `mesos-master --help`.

mesos::slave

Key Type Description Default
[:mesos][:prefix] String Prefix value to be passed to configure script. This value will be overridden by /usr/local when you choose mesosphere. /usr/local
[:mesos][:slave][:master] String [REQUIRED] mesos master url.This should be ip:port for non-ZooKeeper based masters, otherwise a zk:// . when mesosphere, you should set zk:// address.
[:mesos][:slave][:<option_name>] String You can set arbitrary command line option for mesos-slave. See [here](http://mesos.apache.org/documentation/latest/configuration/) for available options or the output of `mesos-slave --help`.

Testing

There are a couple of test suites

  • chefspec for unit tests.
  • test-kitchen with serverspec for integration tests (using vagrant).

in place, which tests both source and mesosphere installations (as well as master and slave recipes).

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Cookbook for Mesos (http://mesos.apache.org/).

https://github.com/everpeace/cookbook-mesos