Skip to content

Commit d70b90d

Browse files
author
Cosmin Lehene
committed
Changed templates to set MESOS_ env vars
This may cause conflicts, but it's better than relying on Mesosphere script that all it seems to do is to replace these with MESOS prefixed vars anyway.
1 parent 0a90409 commit d70b90d

File tree

3 files changed

+40
-32
lines changed

3 files changed

+40
-32
lines changed

manifests/slave.pp

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
$secret = undef,
7676
$syslog_logger = true,
7777
$force_provider = undef, #temporary workaround for starting services
78+
$containerizers = "docker,mesos",
7879
$use_hiera = $mesos::use_hiera,
7980
$single_role = $mesos::single_role,
8081
) inherits mesos {

templates/master.erb

+12-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/sh
21
# Managed by Puppet
32
#
43
# A list of the available options can be seen by running `mesos-master --help`. Each
@@ -11,30 +10,18 @@
1110
# Configuration values are searched for first in the environment, thus values set
1211
# in here precede those loaded from /etc/mesos-master (passed as command line arguments).
1312

14-
# ZooKeeper URL (used for leader election amongst masters)
15-
export MESOS_ZK="<%= @zookeeper_url %>"
13+
MESOS_WORK_DIR="<%= @work_dir %>"
14+
MESOS_ZK="<%= @zookeeper %>"
15+
MESOS_QUORUM=<%= @quorum %>
16+
<% if @listen_address && @listen_address != "" %>
17+
MESOS_IP="<%= @listen_address %>"
18+
<% end %>
19+
MESOS_PORT=<%= @master_port %>
20+
MESOS_CLUSTER="<%= @cluster %>"
21+
MESOS_LOG_DIR="<%= @log_dir %>"
22+
MESOS_LOGBUFSECS=1
23+
MESOS_LOGGING_LEVEL="INFO"
1624

17-
# The size of the quorum of replicas when using 'replicated_log' based
18-
# registry. It is imperative to set this value to be a majority of
19-
# masters i.e., quorum > (number of masters)/2.
20-
21-
QUORUM=<%= @quorum %>
22-
23-
# Human readable name for the cluster, displayed in the webui
24-
export MESOS_CLUSTER="<%= @cluster %>"
25-
26-
# IP address to listen on (in case that you start master
27-
# on this node, it will bind to this address)
28-
<% if @listen_address -%>
29-
export MESOS_IP="<%= @listen_address %>"
30-
<% else -%>
31-
#export MESOS_IP=""
32-
<% end -%>
33-
34-
# Port to listen on (default: 5050)
35-
export MESOS_PORT=<%= @master_port %>
36-
37-
# master environment variables
3825
<% @env_var.sort.each do |key,val| -%>
39-
export <%= key %>="<%= val %>"
26+
<%= key %>="<%= val %>"
4027
<% end if @env_var -%>

templates/slave.erb

+27-7
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,46 @@
1515
# If zookeeper URL is not specified, slaves will connect directly
1616
# to specified master (not a fault-tolerant mode)
1717
<% if !@zookeeper_url.nil? && !@zookeeper_url.empty? -%>
18-
export MESOS_MASTER="<%= @zookeeper_url %>"
18+
MESOS_MASTER="<%= @zookeeper_url %>"
1919
<% else -%>
20-
export MESOS_MASTER="<%= @master %>:<%= @master_port %>"
20+
MESOS_MASTER="<%= @master %>:<%= @master_port %>"
2121
<% end -%>
2222

2323
# public slave's ip, must be unique in mesos cluster
2424
<% if @listen_address -%>
25-
export MESOS_IP="<%= @listen_address %>"
25+
MESOS_IP="<%= @listen_address %>"
2626
<% else -%>
27-
#export MESOS_IP=""
27+
#MESOS_IP=""
2828
<% end -%>
2929

3030
# Port to listen on (default: 5051)
31-
export MESOS_PORT=<%= @port %>
31+
MESOS_PORT=<%= @port %>
3232

3333
<% @cgroups.sort.each do |key, val| -%>
34-
export MESOS_CGROUPS_<%= key.upcase %>="<%= val %>"
34+
MESOS_CGROUPS_<%= key.upcase %>="<%= val %>"
3535
<% end if @isolation == 'cgroups' -%>
3636

37+
38+
MESOS_isolation='cgroups/cpu,cgroups/mem'
39+
MESOS_cgroups_root='system.slice/mesos-slave.service'
40+
MESOS_cgroups_hierarchy=/sys/fs/cgroup
41+
MESOS_slave_subsystems=cpu,memory
42+
MESOS_gc_delay=1days
43+
44+
MESOS_executor_registration_timeout=5mins
45+
46+
<% if @listen_address && @listen_address != "" %>
47+
MESOS_ip="<%= @listen_address %>"
48+
<% end %>
49+
MESOS_port=<%= @port %>
50+
MESOS_log_dir="<%= @log_dir %>"
51+
MESOS_logbufsecs=1
52+
MESOS_logging_level="INFO"
53+
#TODO(clehene) note that we're also passing -containerizers to mesos-slave as this doesn't seem to be working
54+
MESOS_containerizers=<%= @containerizers %>
55+
MESOS_hadoop_home=$HADOOP_HOME
56+
3757
# slave environment variables
3858
<% @env_var.sort.each do |key,val| -%>
39-
export <%= key %>="<%= val %>"
59+
<%= key %>="<%= val %>"
4060
<% end if @env_var -%>

0 commit comments

Comments
 (0)