reddit/puppet-mesos

Name: puppet-mesos

Owner: Reddit

Description: Puppet module for managing Mesos nodes

Created: 2016-02-02 21:39:49.0

Updated: 2016-07-01 17:37:50.0

Pushed: 2016-02-02 21:51:18.0

Homepage: https://forge.puppetlabs.com/deric/mesos

Size: 239

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Mesos Puppet Module

Puppet Forge Build Status

COMPATIBILITY NOTE: current version (0.6.x) requires puppetlabs-apt >= 2.1.0 which has significantly refactored API (doesn't matter if you don't wanna use Mesosphere APT repo).

For installing master

s{'mesos::master':
okeeper  => 'zk://192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181/mesos',
rk_dir => '/var/lib/mesos',
tions => {
quorum   => 2


example slave configuration:

s{'mesos::slave':
okeeper  => 'zk://192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181/mesos',
sten_address => $::ipaddress,
tributes => {
'env' => 'production',

sources => {
'ports' => '[2000-65535]'


for using Hiera and other options see below.

Shared parameters

Parameters:

Master

Should be as simple as this, on master node:

s{'mesos::master': }

optionally you can specify some parameters or it is possible to configure Mesos via Hiera (see below).

s{'mesos::master':
ster_port => 5050,
rk_dir => '/var/lib/mesos',
tions => {
quorum   => 4


For slave you have to specify either master

s{'mesos::slave':
ster => '192.168.1.1'

or zookeeper node(s) to connect:

s{'mesos::slave':
okeeper => 'zk://192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181/mesos'

listen address

If you want to change the IP address Mesos is binding to, you can either provide a Puppet Fact:

s{'mesos::master':
sten_address => $::ipaddress_eth0

or directly use some IP address:

s{'mesos::master':
sten_address => '192.168.1.1'

By default no IP address is set, which means that Mesos will use IP to which translates hostname -f (you can influence bind address simply in /etc/hosts).

Slave
s{'mesos::slave':
ster  => '192.168.1.1',
v_var => {
'JAVA_HOME' => '/usr/bin/java'


in a similar manner you can specify cgroups isolation:

s{'mesos::slave':
okeeper  => 'zk://192.168.1.1:2181/mesos',
olation  => 'cgroups/cpu,cgroups/mem',
roups    => {
'hierarchy' => '/sys/fs/cgroup',
'root'      => 'mesos',


File based configuration

As Mesos configuration flags changes with each version we don't provide directly a named parameter for each flag. mesos::property allows to create a parameter file or remove the file when value is left empty. e.g. configure value in /etc/mesos/hostname:

sos::property { 'hostname':
lue => 'mesos.hostname.com',
r   => '/etc/mesos'

Remove this file simply set value to undef:

sos::property { 'hostname':
lue => undef,
r   => '/etc/mesos'

This is equivalent approach to

s{'mesos::slave':
tions => {
'hostname' => 'mesos.hostname.com'


which will create a file /etc/mesos-slave/hostname with content mesos.hostname.com (where /etc/mesos-slave is a slave's $conf_dir).

Yet another option would be to pass this value via Hiera (see the section below).

Boolean flags

Current Mesos packages recognizes boolean flags like --[no-]quiet via files named as /etc/mesos-slave/?quiet for --quiet (true) and /etc/mesos-slave/?no-quiet for false value.

s{'mesos::slave':
tions => {
'quiet' => true


since 0.4.1

Hiera support

All configuration could be handled by hiera.

Either specify one master

s::master      : '192.168.1.1'

or Zookeeper could be use for a fault-tolerant setup (multiple instances of zookeeper are separated by comma):

s::zookeeper   : 'zk://192.168.1.1:2181/mesos'

Some parameters are shared between master and slave nodes:

s::master_port : 5050
s::log_dir     : '/var/log/mesos'
s::conf_dir    : '/etc/mesos'
s::owner       : 'mesos'
s::group       : 'mesos'

Other are master specific:

s::master::cluster     : 'my_mesos_cluster'
s::master::whitelist   : '*'

or slave specific:

s:slave::env_var:
VA_HOME: '/usr/bin/java'

Mesos service reads configuration either from ENV variables or from configuration files wich are stored in /etc/mesos-slave resp. /etc/mesos-master. Hash passed via options will be converted to config files. Most of the options is possible to configure this way:

s::master::options:
bui_dir: '/usr/local/share/mesos/webui'
orum: '4'

you can also use facts from Puppet:

s::master::options:
stname: "%{::fqdn}"

cgroups with Hiera:

s::slave::isolation: 'cgroups/cpu,cgroups/mem'
s::slave::cgroups:
erarchy: '/sys/fs/cgroup'

Limit resources used by Mesos slave:

s::slave::resources:
us: '10'
Python installation

Python is required for Mesos Web UI and for CLI as well. Installing Python with Mesos should be responsibility of binary packages (Mesos could be build without UI), therefore this behaviour is not enabled by default.

You can enable this feature with following:

s{'mesos':
nage_python => true

or change Python package name, to match your needs:

s{'mesos':
nage_python => true,
thon_package => 'python-dev'

Software repository

Software repositories could be enabled by defining a source:

s::repo: 'mesosphere'

or in Puppet code:

s{'mesos':
po => 'mesosphere'

by default this feature is disabled and right we support mesosphere.io repositories for:

Feel free to send PR for other distributions/package sources.

Overriding service providers

Some Mesos packages does not respect conventions on given OS for starting services. For both mesos::master and mesos::slave you can specify mechanism which will be used for starting services.

s{'mesos::master':
rce_provider => 'upstart'

If you want to create the service resource yourself, set force_provider to none.

Some reasonable values are:

Packages

You can build package by yourself and upload package to your software repository. Or use packages from mesosphere.io:

Requirements
Dependencies
Installation

Preferred installation is via puppet-librarian just add to Puppetfile:

'deric/mesos', '>= 0.6.0'

for latest version from git:

'deric/mesos', :git => 'git://github.com/deric/puppet-mesos.git'
Links

For more information see Mesos project

License

Apache License 2.0

Contributors

Alphabetical list of contributors (not necessarily up-to-date), generated by command git log --format='%aN' | sort -u | sed -e 's/^/\- /':


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.