mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
135 lines
3.3 KiB
Text
135 lines
3.3 KiB
Text
[[cluster-update-settings]]
|
|
=== Cluster update settings API
|
|
++++
|
|
<titleabbrev>Cluster update settings</titleabbrev>
|
|
++++
|
|
|
|
..New API reference
|
|
[sidebar]
|
|
--
|
|
For the most up-to-date API details, refer to {api-es}/group/endpoint-cluster[Cluster APIs].
|
|
--
|
|
|
|
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-desc]]
|
|
==== {api-description-title}
|
|
|
|
:strip-api-link: true
|
|
include::{es-ref-dir}/setup/configuration.asciidoc[tag=cluster-setting-precedence]
|
|
|
|
[[cluster-update-settings-api-query-params]]
|
|
==== {api-query-parms-title}
|
|
|
|
include::{es-ref-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-ref-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:
|
|
|
|
// tag::transient-settings-warning[]
|
|
[WARNING]
|
|
====
|
|
We no longer recommend using transient cluster settings. Use persistent cluster
|
|
settings instead. If a cluster becomes unstable, transient settings can clear
|
|
unexpectedly, resulting in a potentially undesired cluster configuration.
|
|
// See the <<transient-settings-migration-guide>>.
|
|
====
|
|
// end::transient-settings-warning[]
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_cluster/settings?flat_settings=true
|
|
{
|
|
"transient" : {
|
|
"indices.recovery.max_bytes_per_sec" : "20mb"
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
|
|
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
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
|
|
|
|
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
|
|
}
|
|
}
|
|
--------------------------------------------------
|