Merge "Get rid of auto_expand_replicas for Kibana indices"

This commit is contained in:
Jenkins 2017-01-11 13:35:22 +00:00 committed by Gerrit Code Review
commit 6c95cc266b
3 changed files with 14 additions and 6 deletions

View File

@ -17,6 +17,7 @@ notice('fuel-plugin-elasticsearch-kibana: kibana_index_configuration.pp')
$vip = hiera('lma::elasticsearch::vip')
$es_port = hiera('lma::elasticsearch::rest_port')
$kibana_index = hiera('lma::elasticsearch::kibana_index')
$number_of_replicas = hiera('lma::elasticsearch::number_of_replicas')
# Elasticsearch must be reachable through HAproxy before the template creation.
# This is due the fact that The Elasticsearch Puppet module miserably fails
@ -34,10 +35,11 @@ haproxy_backend_status { 'elasticsearch':
# Then, correct fields mapping are present before importing objects
# (searches, visualizations and dashboards).
lma_logging_analytics::es_template { 'kibana4':
host => $vip,
port => $es_port,
index_template => $kibana_index,
require => Haproxy_backend_status['elasticsearch'],
number_of_replicas => $number_of_replicas,
host => $vip,
port => $es_port,
index_template => $kibana_index,
require => Haproxy_backend_status['elasticsearch'],
}
# Import all Kibana objects in one time by issuing a Bulk request

View File

@ -21,6 +21,7 @@ $kibana_vip = hiera('lma::kibana::vip')
$kibana_viewer_port = hiera('lma::elasticsearch::kibana_frontend_viewer_port')
$es_port = hiera('lma::elasticsearch::rest_port')
$number_of_replicas = hiera('lma::elasticsearch::number_of_replicas')
$kibana_index = hiera('lma::elasticsearch::kibana_index')
$authnz = hiera_hash('lma::kibana::authnz')
if $authnz['ldap_enabled'] and $authnz['ldap_authorization_enabled'] {
@ -66,6 +67,12 @@ lma_logging_analytics::es_template { ['log', 'notification']:
port => $es_port,
}
# Adjust the number of replicas for the Kibana index
exec { 'adjust_kibana_replicas':
command => "/usr/bin/curl -sL -XPUT http://${es_vip}:${es_port}/${kibana_index}/_settings \
-d '{\"index\": {\"number_of_replicas\": ${number_of_replicas}}}'"
}
$kibana_link_created_file = '/var/cache/kibana_link_created'
exec { 'notify_kibana_url':
creates => $kibana_link_created_file,

View File

@ -132,8 +132,7 @@
},
"settings": {
"number_of_shards": <%= @number_of_shards %>,
"auto_expand_replicas": "0-all"
"number_of_replicas": <%= @number_of_replicas %>
},
"template": "<%= @template %>"
}