121 lines
3.1 KiB
Plaintext
121 lines
3.1 KiB
Plaintext
[[cluster-update-settings]]
|
|
=== Cluster update settings API
|
|
++++
|
|
<titleabbrev>Cluster update settings</titleabbrev>
|
|
++++
|
|
|
|
Configures <<dynamic-cluster-setting,dynamic cluster settings>>.
|
|
|
|
|
|
[[cluster-update-settings-api-request]]
|
|
==== {api-request-title}
|
|
|
|
`PUT /_cluster/settings`
|
|
|
|
[[cluster-update-settings-api-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
* If the {es} {security-features} are enabled, you must have the `manage`
|
|
<<privileges-list-cluster,cluster privilege>> to use this API.
|
|
|
|
[[cluster-update-settings-api-query-params]]
|
|
==== {api-query-parms-title}
|
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
|
|
|
|
`include_defaults`::
|
|
(Optional, Boolean) If `true`, returns all default cluster settings.
|
|
Defaults to `false`.
|
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|
|
|
|
|
[[cluster-update-settings-api-example]]
|
|
==== {api-examples-title}
|
|
|
|
An example of a persistent update:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_cluster/settings
|
|
{
|
|
"persistent" : {
|
|
"indices.recovery.max_bytes_per_sec" : "50mb"
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
|
|
|
|
An example of a transient update:
|
|
|
|
NOTE: Transient settings are deprecated and will be removed in a future release.
|
|
Use persistent cluster settings instead.
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_cluster/settings?flat_settings=true
|
|
{
|
|
"transient" : {
|
|
"indices.recovery.max_bytes_per_sec" : "20mb"
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TEST[warning:[transient settings removal] Updating cluster settings through transientSettings is deprecated. Use persistent settings instead.]
|
|
|
|
The response to an update returns the changed setting, as in this response to
|
|
the transient example:
|
|
|
|
[source,console-result]
|
|
--------------------------------------------------
|
|
{
|
|
...
|
|
"persistent" : { },
|
|
"transient" : {
|
|
"indices.recovery.max_bytes_per_sec" : "20mb"
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
|
|
|
|
|
|
This example resets a setting:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_cluster/settings
|
|
{
|
|
"transient" : {
|
|
"indices.recovery.max_bytes_per_sec" : null
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TEST[warning:[transient settings removal] Updating cluster settings through transientSettings is deprecated. Use persistent settings instead.]
|
|
|
|
|
|
The response does not include settings that have been reset:
|
|
|
|
[source,console-result]
|
|
--------------------------------------------------
|
|
{
|
|
...
|
|
"persistent" : {},
|
|
"transient" : {}
|
|
}
|
|
--------------------------------------------------
|
|
// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
|
|
|
|
|
|
You can also reset settings using wildcards. For example, to reset
|
|
all dynamic `indices.recovery` settings:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_cluster/settings
|
|
{
|
|
"transient" : {
|
|
"indices.recovery.*" : null
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TEST[warning:[transient settings removal] Updating cluster settings through transientSettings is deprecated. Use persistent settings instead.]
|