Give elasticsearch more heap memory.

* modules/logstash/files/elasticseach.default: Elasticsearch does not
handle running out of memory very gracefully. Recommended allocation is
half of the hosts memory. Give elasticsearch 4GB of the 8GB host.

* modules/logstash/manifests/elasticseach.pp: Copy new elasticsearch
defaults file into place on the host.

Change-Id: I9ed14148c901cd3fd4ec38333a722821adb77ff5
Reviewed-on: https://review.openstack.org/27870
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2013-04-30 17:03:54 -07:00 committed by Jenkins
parent 6d5bc62b64
commit 4b1d2cf531
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,38 @@
# Run ElasticSearch as this user ID and group ID
#ES_USER=elasticsearch
#ES_GROUP=elasticsearch
# Heap Size (defaults to 256m min, 1g max)
ES_HEAP_SIZE=4g
# Heap new generation
#ES_HEAP_NEWSIZE=
# max direct memory
#ES_DIRECT_SIZE=
# Maximum number of open files, defaults to 65535.
#MAX_OPEN_FILES=65535
# Maximum locked memory size. Set to "unlimited" if you use the
# bootstrap.mlockall option in elasticsearch.yml. You must also set
# ES_HEAP_SIZE.
#MAX_LOCKED_MEMORY=unlimited
# ElasticSearch log directory
#LOG_DIR=/var/log/elasticsearch
# ElasticSearch data directory
#DATA_DIR=/var/lib/elasticsearch
# ElasticSearch work directory
#WORK_DIR=/tmp/elasticsearch
# ElasticSearch configuration directory
#CONF_DIR=/etc/elasticsearch
# ElasticSearch configuration file (elasticsearch.yml)
#CONF_FILE=/etc/elasticsearch/elasticsearch.yml
# Additional Java OPTS
#ES_JAVA_OPTS=

View File

@ -47,9 +47,22 @@ class logstash::elasticsearch {
require => Package['elasticsearch'],
}
file { '/etc/default/elasticsearch':
ensure => present,
source => 'puppet:///modules/logstash/elasticsearch.default',
replace => true,
owner => 'root',
group => 'root',
mode => '0644',
require => Package['elasticsearch'],
}
service { 'elasticsearch':
ensure => running,
require => Package['elasticsearch'],
subscribe => File['/etc/elasticsearch/elasticsearch.yml'],
subscribe => [
File['/etc/elasticsearch/elasticsearch.yml'],
File['/etc/default/elasticsearch'],
],
}
}