From 053f98b4ee408d249ba92046d1dc134fa5964860 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 18 Oct 2013 16:59:47 -0700 Subject: [PATCH] Make ES Heap Size configurable. wiki.o.o is much smaller than our typical elasticsearch nodes. For it to use elasticsearch it needs to allocate a much smaller heap. Make the heap size configurable (keep the 16g default) and set the heap size to 1g for wiki.o.o. Change-Id: I0c5fb4865eb07c0fa5bbe4cf698a9f0e9ea9f2fc --- modules/elasticsearch/manifests/init.pp | 5 +++-- .../elasticsearch.default.erb} | 2 +- modules/openstack_project/manifests/wiki.pp | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) rename modules/elasticsearch/{files/elasticsearch.default => templates/elasticsearch.default.erb} (96%) diff --git a/modules/elasticsearch/manifests/init.pp b/modules/elasticsearch/manifests/init.pp index 560edc58a0..661ffe9436 100644 --- a/modules/elasticsearch/manifests/init.pp +++ b/modules/elasticsearch/manifests/init.pp @@ -16,7 +16,8 @@ # class elasticsearch ( $discover_nodes = ['localhost'], - $version = '0.20.5' + $version = '0.20.5', + $heap_size = '16g' ) { # install java runtime package { 'java7-runtime-headless': @@ -96,7 +97,7 @@ class elasticsearch ( file { '/etc/default/elasticsearch': ensure => present, - source => 'puppet:///modules/elasticsearch/elasticsearch.default', + content => template('elasticsearch/elasticsearch.default.erb'), replace => true, owner => 'root', group => 'root', diff --git a/modules/elasticsearch/files/elasticsearch.default b/modules/elasticsearch/templates/elasticsearch.default.erb similarity index 96% rename from modules/elasticsearch/files/elasticsearch.default rename to modules/elasticsearch/templates/elasticsearch.default.erb index 1d1aac6438..97ca4500db 100644 --- a/modules/elasticsearch/files/elasticsearch.default +++ b/modules/elasticsearch/templates/elasticsearch.default.erb @@ -3,7 +3,7 @@ #ES_GROUP=elasticsearch # Heap Size (defaults to 256m min, 1g max) -ES_HEAP_SIZE=16g +ES_HEAP_SIZE=<%= heap_size %> # Heap new generation #ES_HEAP_NEWSIZE= diff --git a/modules/openstack_project/manifests/wiki.pp b/modules/openstack_project/manifests/wiki.pp index 249a0a6b81..cf32bb2569 100644 --- a/modules/openstack_project/manifests/wiki.pp +++ b/modules/openstack_project/manifests/wiki.pp @@ -60,6 +60,7 @@ class openstack_project::wiki ( class { '::elasticsearch': discover_nodes => ['localhost'], version => '0.90.5', + heap_size => '1g', } }