From 868ad1ff0f0b9f25d8274af682cbcfbea69c653b Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 8 May 2013 14:15:54 -0700 Subject: [PATCH] Further elasticsearch config tweaks. * modules/logstash/files/elasticsearch.yml: Set the number of elasticsearch shards to 1 and the number of replicas to 0 as we are not running a cluster, just a single node. * modules/openstack_project/manifests/logstash.pp: Update elasticsearch indice optimization cron job's max_num_segments value from 1 to 2. These options are suggested at https://github.com/logstash/logstash/wiki/Elasticsearch-Storage-Optimization Change-Id: I747ab8952f0102ba582e213407909aaeebcf2778 Reviewed-on: https://review.openstack.org/28616 Reviewed-by: Jeremy Stanley Reviewed-by: Khai Do Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins --- modules/logstash/files/elasticsearch.yml | 6 ++++++ modules/openstack_project/manifests/logstash.pp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/logstash/files/elasticsearch.yml b/modules/logstash/files/elasticsearch.yml index edd172109a..39d1dad9c3 100644 --- a/modules/logstash/files/elasticsearch.yml +++ b/modules/logstash/files/elasticsearch.yml @@ -114,6 +114,12 @@ # index.number_of_shards: 1 # index.number_of_replicas: 0 +# Set number of shards to 1 and replicas to 0 as we are not running an elastic +# search cluster and https://github.com/logstash/logstash/wiki/Elasticsearch-Storage-Optimization +# recommends this configuration. +index.number_of_shards: 1 +index.number_of_replicas: 0 + # These settings directly affect the performance of index and search operations # in your cluster. Assuming you have enough machines to hold shards and # replicas, the rule of thumb is: diff --git a/modules/openstack_project/manifests/logstash.pp b/modules/openstack_project/manifests/logstash.pp index db9813dd7b..1e10373e73 100644 --- a/modules/openstack_project/manifests/logstash.pp +++ b/modules/openstack_project/manifests/logstash.pp @@ -94,7 +94,7 @@ class openstack_project::logstash ( user => 'root', hour => '5', minute => '0', - command => 'curl -sS -XPOST "http://localhost:9200/logstash-`date -d yesterday +\%Y.\%m.\%d`/_optimize" -d \'max_num_segments=1\'', + command => 'curl -sS -XPOST "http://localhost:9200/logstash-`date -d yesterday +\%Y.\%m.\%d`/_optimize?max_num_segments=2"', environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', } }