For installing master
class{'mesos::master':
zookeeper => 'zk://192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181/mesos',
work_dir => '/var/lib/mesos',
options => {
quorum => 2
}
}
slaves:
class{'mesos::slave':
zookeeper => 'zk://192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181/mesos',
listen_address => $::ipaddress
}
for using Hiera and other options see below.
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
- multiple ZooKeepers:
- single ZooKeeper:
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 Puppetenv_var
- shared master/slave execution environment variables (see example under slave)version
- install specific version of Mesos
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
- for list of supported options see
env_var
- master's execution environment variables (see example under slave)
If you want to change the IP address Mesos is binding to, you can either provide a Puppet Fact:
class{'mesos::master':
listen_address => $::ipaddress_eth0
}
or directly use some IP address:
class{'mesos::master':
listen_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
).
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 seemesos-slave --help
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
:
::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'
}
This is equivalent approach to
class{'mesos::slave':
options => {
'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).
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.
class{'mesos::slave':
options => {
'quiet' => true
}
}
since 0.4.1
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'
APT repository could be enabled with:
mesos::repo: 'mesosphere'
by default this feature is disabled and right now only Debian/Ubuntu (from mesosphere.io) is supported. Feel free to send PR for other distributions/package sources.
You can build package by yourself and upload package to your software repository. Or use packages from mesosphere.io:
- Debian/Ubuntu
- RedHat/CentOS
- Puppet > 2.6
- stdlib version
>= 4.2.0
- we need functionis_bool
Preferred installation is via puppet-librarian just add to Puppetfile
:
mod 'deric/mesos', '>= 0.4.0'
for latest version from git:
mod 'deric/mesos', :git => 'git://github.com/deric/puppet-mesos.git'
For more information see Mesos project
Apache License 2.0