2018-01-25 16:49:30 -05:00
|
|
|
[role="xpack"]
|
2018-06-22 18:39:34 -04:00
|
|
|
[testenv="basic"]
|
2018-01-25 16:49:30 -05:00
|
|
|
[[config-monitoring-indices]]
|
2019-09-24 13:35:06 -04:00
|
|
|
== Configuring indices for monitoring
|
2018-01-25 16:49:30 -05:00
|
|
|
|
|
|
|
<<indices-templates,Index templates>> are used to configure the indices
|
|
|
|
that store the monitoring data collected from a cluster.
|
|
|
|
|
|
|
|
You can retrieve the templates through the `_template` API:
|
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2018-01-25 16:49:30 -05:00
|
|
|
----------------------------------
|
|
|
|
GET /_template/.monitoring-*
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
By default, the template configures one shard and one replica for the
|
|
|
|
monitoring indices. To override the default settings, add your own template:
|
|
|
|
|
|
|
|
. Set the `template` pattern to `.monitoring-*`.
|
|
|
|
. Set the template `order` to `1`. This ensures your template is
|
|
|
|
applied after the default template, which has an order of 0.
|
|
|
|
. Specify the `number_of_shards` and/or `number_of_replicas` in the `settings`
|
|
|
|
section.
|
|
|
|
|
|
|
|
For example, the following template increases the number of shards to five
|
|
|
|
and the number of replicas to two.
|
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2018-01-25 16:49:30 -05:00
|
|
|
----------------------------------
|
|
|
|
PUT /_template/custom_monitoring
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"index_patterns": ".monitoring-*",
|
|
|
|
"order": 1,
|
|
|
|
"settings": {
|
|
|
|
"number_of_shards": 5,
|
|
|
|
"number_of_replicas": 2
|
|
|
|
}
|
2018-01-25 16:49:30 -05:00
|
|
|
}
|
|
|
|
----------------------------------
|
|
|
|
|
2020-01-28 09:36:29 -05:00
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
DELETE /_template/custom_monitoring
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2018-01-25 16:49:30 -05:00
|
|
|
IMPORTANT: Only set the `number_of_shards` and `number_of_replicas` in the
|
|
|
|
settings section. Overriding other monitoring template settings could cause
|
|
|
|
your monitoring dashboards to stop working correctly.
|