elasticsearch/docs/reference/cluster/update-settings.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

130 lines
3.1 KiB
Text

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