123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- [[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
- }
- }
- --------------------------------------------------
|