Merge "Get rid of auto_expand_replicas for Kibana indices"
This commit is contained in:
commit
6c95cc266b
|
@ -17,6 +17,7 @@ notice('fuel-plugin-elasticsearch-kibana: kibana_index_configuration.pp')
|
||||||
$vip = hiera('lma::elasticsearch::vip')
|
$vip = hiera('lma::elasticsearch::vip')
|
||||||
$es_port = hiera('lma::elasticsearch::rest_port')
|
$es_port = hiera('lma::elasticsearch::rest_port')
|
||||||
$kibana_index = hiera('lma::elasticsearch::kibana_index')
|
$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.
|
# Elasticsearch must be reachable through HAproxy before the template creation.
|
||||||
# This is due the fact that The Elasticsearch Puppet module miserably fails
|
# 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
|
# Then, correct fields mapping are present before importing objects
|
||||||
# (searches, visualizations and dashboards).
|
# (searches, visualizations and dashboards).
|
||||||
lma_logging_analytics::es_template { 'kibana4':
|
lma_logging_analytics::es_template { 'kibana4':
|
||||||
host => $vip,
|
number_of_replicas => $number_of_replicas,
|
||||||
port => $es_port,
|
host => $vip,
|
||||||
index_template => $kibana_index,
|
port => $es_port,
|
||||||
require => Haproxy_backend_status['elasticsearch'],
|
index_template => $kibana_index,
|
||||||
|
require => Haproxy_backend_status['elasticsearch'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Import all Kibana objects in one time by issuing a Bulk request
|
# Import all Kibana objects in one time by issuing a Bulk request
|
||||||
|
|
|
@ -21,6 +21,7 @@ $kibana_vip = hiera('lma::kibana::vip')
|
||||||
$kibana_viewer_port = hiera('lma::elasticsearch::kibana_frontend_viewer_port')
|
$kibana_viewer_port = hiera('lma::elasticsearch::kibana_frontend_viewer_port')
|
||||||
$es_port = hiera('lma::elasticsearch::rest_port')
|
$es_port = hiera('lma::elasticsearch::rest_port')
|
||||||
$number_of_replicas = hiera('lma::elasticsearch::number_of_replicas')
|
$number_of_replicas = hiera('lma::elasticsearch::number_of_replicas')
|
||||||
|
$kibana_index = hiera('lma::elasticsearch::kibana_index')
|
||||||
|
|
||||||
$authnz = hiera_hash('lma::kibana::authnz')
|
$authnz = hiera_hash('lma::kibana::authnz')
|
||||||
if $authnz['ldap_enabled'] and $authnz['ldap_authorization_enabled'] {
|
if $authnz['ldap_enabled'] and $authnz['ldap_authorization_enabled'] {
|
||||||
|
@ -66,6 +67,12 @@ lma_logging_analytics::es_template { ['log', 'notification']:
|
||||||
port => $es_port,
|
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'
|
$kibana_link_created_file = '/var/cache/kibana_link_created'
|
||||||
exec { 'notify_kibana_url':
|
exec { 'notify_kibana_url':
|
||||||
creates => $kibana_link_created_file,
|
creates => $kibana_link_created_file,
|
||||||
|
|
|
@ -132,8 +132,7 @@
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"number_of_shards": <%= @number_of_shards %>,
|
"number_of_shards": <%= @number_of_shards %>,
|
||||||
"auto_expand_replicas": "0-all"
|
"number_of_replicas": <%= @number_of_replicas %>
|
||||||
},
|
},
|
||||||
"template": "<%= @template %>"
|
"template": "<%= @template %>"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue