Forge Home

mesos

Module managing Mesos master and slave instalation

1,311,892 downloads

2,488 latest version

3.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.1.0 (latest)
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 0.9.2 (deleted)
  • 0.9.1
  • 0.9.0
  • 0.8.4
  • 0.8.3 (deleted)
  • 0.8.2
  • 0.8.1
  • 0.8.0
  • 0.7.1
  • 0.7.0
  • 0.6.5
  • 0.6.4
  • 0.6.3
  • 0.6.2
  • 0.6.1
  • 0.6.0
  • 0.5.3
  • 0.5.2
  • 0.5.1
  • 0.5.0
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.1
  • 0.3.0
  • 0.2.0
  • 0.1.2
released Jul 22nd 2014

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'deric-mesos', '0.4.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add deric-mesos
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install deric-mesos --version 0.4.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: cluster, mesos

Documentation

deric/mesos — version 0.4.0 Jul 22nd 2014

Mesos Puppet Module

Build Status

This is a Puppet module for managing Mesos nodes in a cluster.

Requirements

Usage

Parameters:

  • zookeeper - ZooKeeper URL which is used for slaves connecting to the master and also for leader election, e.g.:
    • single ZooKeeper: zk://127.0.0.1:2181/mesos (which isn't fault tolerant)
      • multiple ZooKeepers: zk://192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181/mesos (usually 3 or 5 ZooKeepers should be enough)
      • ZooKeeper URL will be stored in /etc/mesos/zk
  • conf_dir - directory with simple configuration files containing master/slave parameters (name of the file is a key, contents its value)
     - this directory will be completely managed by Puppet
    

Master

Should be as simple as this, on master node:

class{'mesos::master': }

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

class{'mesos::master':
  master_port => 5050,
  work_dir => '/var/lib/mesos',
  options => {
    quorum   => 4
  }
}

For slave you have to specify either master

class{'mesos::slave':
  master => '192.168.1.1'
}

or zookeeper node(s) to connect:

class{'mesos::slave':
  zookeeper => 'zk://192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181/mesos'
}
  • conf_dir default value is /etc/mesos-master (this directory will be purged by Puppet!)
    • for list of supported options see mesos-master --help

Slave

  • enable - install Mesos slave service (default: true)
  • port - slave's port for incoming connections (default: 5051)
  • master- ip address of Mesos master (default: localhost)
  • master_port - Mesos master's port (default: 5050)
  • work_dir - directory for storing task's temporary files (default: /tmp/mesos)
  • env_var - slave's execution environment variables - a Hash, if you are using Java, you might need e.g.:
class{'mesos::slave':
  master  => '192.168.1.1',
  env_var => {
    'JAVA_HOME' => '/usr/bin/java'
  }
}

in a similar manner you can specify cgroups isolation:

class{'mesos::slave':
  zookeeper  => 'zk://192.168.1.1:2181/mesos',
  isolation  => 'cgroups',
  cgroups    => {
    'hierarchy' => '/sys/fs/cgroup',
    'root'      => 'mesos',
  }
}
  • conf_dir default value is /etc/mesos-slave (this directory will be purged by Puppet!)
     - for list of supported options see `mesos-slave --help`
    

File based configuration

If some file based configurations this module doesn't provide directly in master and slave module, mesos::property allows to configure them or remove the file when value is left empty. e.g. configure value in /etc/mesos/hostname:

::mesos::property { 'hostname':
  value => 'mesos.hostname.com',
  dir   => '/etc/mesos'
}

Remove this file simply set value to undef:

::mesos::property { 'hostname':
  value => undef,
  dir   => '/etc/mesos'
}

Hiera support

All configuration could be handled by hiera.

Either specify one master

mesos::master      : '192.168.1.1'

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

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

Some parameters are shared between master and slave nodes:

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

Other are master specific:

mesos::master::cluster     : 'my_mesos_cluster'
mesos::master::whitelist   : '*'

or slave specific:

mesos:slave::env_var:
  JAVA_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:

mesos::master::options:
  webui_dir: '/usr/local/share/mesos/webui'
  quorum: '4'

you can also use facts from Puppet:

mesos::master::options:
  hostname: "%{::fqdn}"

cgroups with Hiera:

mesos::slave::isolation: 'cgroups'
mesos::slave::cgroups:
  hierarchy: '/sys/fs/cgroup'

Limit resources used by Mesos slave:

mesos::slave::resources:
  cpus: '10'

Links

For more information see Mesos project

License

Apache License 2.0