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', } }