2013-08-28 19:24:34 -04:00
|
|
|
[[cluster-update-settings]]
|
|
|
|
== Cluster Update Settings
|
|
|
|
|
|
|
|
Allows to update cluster wide specific settings. Settings updated can
|
|
|
|
either be persistent (applied cross restarts) or transient (will not
|
|
|
|
survive a full cluster restart). Here is an example:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
PUT /_cluster/settings
|
|
|
|
{
|
2013-08-28 19:24:34 -04:00
|
|
|
"persistent" : {
|
2017-02-10 17:57:43 -05:00
|
|
|
"indices.recovery.max_bytes_per_sec" : "50mb"
|
2015-06-22 17:49:45 -04:00
|
|
|
}
|
2017-02-10 17:57:43 -05:00
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
// CONSOLE
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
Or:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
PUT /_cluster/settings?flat_settings=true
|
|
|
|
{
|
2013-08-28 19:24:34 -04:00
|
|
|
"transient" : {
|
2017-02-10 17:57:43 -05:00
|
|
|
"indices.recovery.max_bytes_per_sec" : "20mb"
|
2015-06-22 17:49:45 -04:00
|
|
|
}
|
2017-02-10 17:57:43 -05:00
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
// CONSOLE
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
The cluster responds with the settings updated. So the response for the
|
|
|
|
last example will be:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
2017-02-10 17:57:43 -05:00
|
|
|
...
|
|
|
|
"persistent" : { },
|
2013-08-28 19:24:34 -04:00
|
|
|
"transient" : {
|
2017-02-10 17:57:43 -05:00
|
|
|
"indices.recovery.max_bytes_per_sec" : "20mb"
|
2015-06-22 17:49:45 -04:00
|
|
|
}
|
2017-02-10 17:57:43 -05:00
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-12-07 15:19:40 -05:00
|
|
|
Resetting persistent or transient settings can be done by assigning a
|
|
|
|
`null` value. If a transient setting is reset, the persistent setting
|
|
|
|
is applied if available. Otherwise Elasticsearch will fallback to the setting
|
|
|
|
defined at the configuration file or, if not existent, to the default
|
|
|
|
value. Here is an example:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
PUT /_cluster/settings
|
|
|
|
{
|
2015-12-07 15:19:40 -05:00
|
|
|
"transient" : {
|
2017-02-10 17:57:43 -05:00
|
|
|
"indices.recovery.max_bytes_per_sec" : null
|
2015-12-07 15:19:40 -05:00
|
|
|
}
|
2017-02-10 17:57:43 -05:00
|
|
|
}
|
2015-12-07 15:19:40 -05:00
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
// CONSOLE
|
2015-12-07 15:19:40 -05:00
|
|
|
|
|
|
|
Reset settings will not be included in the cluster response. So
|
|
|
|
the response for the last example will be:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
2017-02-10 17:57:43 -05:00
|
|
|
...
|
2015-12-07 15:19:40 -05:00
|
|
|
"persistent" : {},
|
|
|
|
"transient" : {}
|
|
|
|
}
|
2015-12-09 06:24:40 -05:00
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
|
2015-12-09 06:24:40 -05:00
|
|
|
|
|
|
|
Settings can also be reset using simple wildcards. For instance to reset
|
2017-02-10 17:57:43 -05:00
|
|
|
all dynamic `indices.recovery` setting a prefix can be used:
|
2015-12-09 06:24:40 -05:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
PUT /_cluster/settings
|
|
|
|
{
|
2015-12-09 06:24:40 -05:00
|
|
|
"transient" : {
|
2017-02-10 17:57:43 -05:00
|
|
|
"indices.recovery.*" : null
|
2015-12-09 06:24:40 -05:00
|
|
|
}
|
2017-02-10 17:57:43 -05:00
|
|
|
}
|
2015-12-09 06:24:40 -05:00
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
// CONSOLE
|
2015-12-07 15:19:40 -05:00
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
Cluster wide settings can be returned using:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
GET /_cluster/settings
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2017-02-10 17:57:43 -05:00
|
|
|
// CONSOLE
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-11-05 08:40:06 -05:00
|
|
|
[float]
|
|
|
|
=== Precedence of settings
|
|
|
|
|
|
|
|
Transient cluster settings take precedence over persistent cluster settings,
|
|
|
|
which take precedence over settings configured in the `elasticsearch.yml`
|
|
|
|
config file.
|
|
|
|
|
|
|
|
For this reason it is preferrable to use the `elasticsearch.yml` file only
|
|
|
|
for local configurations, and set all cluster-wider settings with the
|
|
|
|
`settings` API.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
A list of dynamically updatable settings can be found in the
|
|
|
|
<<modules,Modules>> documentation.
|
2014-06-25 14:54:22 -04:00
|
|
|
|