Application cookbook for installing the Apache Mesos cluster manager. Mesos provides efficient resource isolation and sharing across distributed applications, or frameworks. This cookbook installs Mesos via packages provided by Mesosphere.
This cookbook serves as the base for the following additional Mesos framework cookbooks maintained by Medidata Solutions:
- marathon - This cookbook installs the Apache Mesos Marathon framework.
- chronos - This cookbook installs the Apache Mesos Chronos framework.
Chef 11.12.2+
This cookbook assumes you will be running a ZooKeeper ensemble for production use of Mesos.
The following cookbooks are dependencies:
- apt
- yum
- java
- docker
The following cookbooks are suggested:
- zookeeper (used for discovering ZooKeeper ensembles via Netflix Exhibitor)
Tested on
- Ubuntu 12.04
- Ubuntu 13.04
- Ubuntu 14.04
- Debian Wheezy
- CentOS 6
- Scientific Linux 6.3
node['mesos']['version']
- Mesosphere Mesos package version. Default: '0.17.0'.node['mesos']['cluster_name']
- Human readable name for the cluster, displayed in the webui. Default: 'MyMesosCluster'.node['mesos']['port']
- Port to listen on. Default: 5050.node['mesos']['logs_dir']
- Location to put log files. Default: '/var/log/mesos'.node['mesos']['work_dir']
- Where to place framework work directories. Default: '/tmp/mesos'node['mesos']['isolation_type']
- Isolation mechanism, may be one of: process, cgroups. Default: 'process'.node['mesos']['zookeeper_server_list']
- List of ZooKeeper hostnames or IP addresses. Default: [].node['mesos']['zookeeper_port']
- ZooKeeper port. Default: 2181.node['mesos']['zookeeper_path']
- ZooKeeper path. Default: 'mesos'.node['mesos']['zookeeper_exhibitor_discovery']
- Flag to enable ZooKeeper ensemble discovery via Netflix Exhibitor. Default: false.node['mesos']['zookeeper_exhibitor_url']
- Netflix Exhibitor ZooKeeper ensemble url.node['mesos']['set_ec2_hostname']
- If true and running in ec2, set hostname to public dns name. Default: true.node['mesos']['python_egg']
- URL of mesos python egg to downloadnode['mesos']['slave']['checkpoint']
- Enable slave recovery. Default: 'true'.node['mesos']['slave']['strict']
- If true, any recovery error is fatal. Default: 'false'.node['mesos']['slave']['recover']
- Whether to recover status updates and reconnect with old executors. Default: 'reconnect'
The default mesos recipe will run mesos::install.
The install recipe pulls down the specified version of the mesosphere mesos package and installs it. It also configures to stop both mesos-master and mesos-slave init files so that they don't automatically start on server restart.
The master recipe runs mesos::install as well as creating several mesos-master configuration files that are used at startup. This recipe also uses the zookeeper attributes and/or exhibitor attributes to configure the mesos-master using zookeeper. Lastly it sets the mesos-master init config to 'start' so that mesos-master is started on server restart.
The slave recipe runs mesos::install as well as creating several mesos-slave configuration files that are used at startup. This recipe also uses the zookeeper attributes and/or exhibitor attributes to configure the mesos-slave using zookeeper. Lastly it sets the mesos-slave init config to 'start' so that mesos-slave is started on server restart.
The docker recipe installs docker via Brian Flad's docker cookbook as well as Jason Dusek's mesos-docker script as a mesos executor. After running this recipe on a mesos slave you should be able to run the mesos-docker examples listed in Jason Dusek's docker on mesos blog post.
Here is a sample role for configuring a Mesos master in a ZooKeeper backed production mode.
chef_type: role
default_attributes:
description:
env_run_lists:
json_class: Chef::Role
name: mesos_master
override_attributes:
mesos:
version: 0.17.0
cluster_name: mesos-sandbox
zookeeper_server_list: [ '203.0.113.2', '203.0.113.3', '203.0.113.4' ]
zookeeper_port: 2181
zookeeper_path: 'mesos-sandbox'
run_list:
recipe[mesos::master]
Here is a sample role for creating a Mesos slave node with a seperate ZooKeeper ensemble dynamically discovered via Netflix Exhibitor:
chef_type: role
default_attributes:
description:
env_run_lists:
json_class: Chef::Role
name: mesos_slave
override_attributes:
mesos:
version: 0.17.0
cluster_name: mesos-sandbox
zookeeper_path: 'mesos'
zookeeper_exhibitor_discovery: true
zookeeper_exhibitor_url: 'http://zk-exhibitor-endpoint.example.com:8080'
run_list:
recipe[mesos::slave]
Here is a sample role for creating a Mesos slave node running the experimental docker executor. This node is also dynamically configured via zookeeper and exhibitor. (Note: this recipe only works with Ubuntu 13.04 as of now.)
chef_type: role
default_attributes:
description:
env_run_lists:
json_class: Chef::Role
name: mesos_slave_docker
override_attributes:
mesos:
version: 0.17.0
cluster_name: mesos-sandbox
zookeeper_path: 'mesos'
zookeeper_exhibitor_discovery: true
zookeeper_exhibitor_url: 'http://zk-exhibitor-endpoint.example.com:8080'
run_list:
recipe[mesos::docker]
Please see the Contributing Guidelines.
- Author: Ray Rodriguez(rayrod2030@gmail.com)
- Author: Mark Corwin
- Contributor: Asher Feldman
- Contributor: Steven Borrelli
Copyright 2014 Medidata Solutions Worldwide
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.