Skip to content

Instantly share code, notes, and snippets.

@chrisboulton
Created March 3, 2013 23:30
Show Gist options
  • Save chrisboulton/5078841 to your computer and use it in GitHub Desktop.
Save chrisboulton/5078841 to your computer and use it in GitHub Desktop.
$default_node_params = {
'name' => $::fqdn,
'data' => $is_data,
'master' => $is_master,
}
# awareness values should be munched into the 'node' config section
$node_params = merge($default_node_params, $awareness_attributes)
class { 'elasticsearch':
restart_on_change => false,
config => {
'node' => $node_params,
'http' => {
'enabled' => $http_enabled,
},
'bootstrap' => {
'mlockall' => true,
},
'cluster' => {
'name' => $cluster,
'routing' => {
'allocation' => {
'awareness' => {
'attributes' => keys($awareness_attributes),
},
},
},
},
'index' => {
'number_of_replicas' => $number_of_replicas,
'number_of_shards' => $number_of_shards,
},
'gateway' => {
'recover_after_nodes' => $recover_after_nodes,
'expected_nodes' => $expected_num_nodes,
'recover_after_time' => '2m',
},
'discovery' => {
'zen' => {
'minimum_master_nodes' => $minmum_master_nodes,
'ping' => {
'multicast' => {
'group' => $multicast_group,
'port' => $multicast_port,
},
'unicast' => {
'hosts' => join($unicast_peers, ','),
},
},
},
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment