update-settings.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. [[cluster-update-settings]]
  2. === Cluster update settings API
  3. ++++
  4. <titleabbrev>Cluster update settings</titleabbrev>
  5. ++++
  6. Configures <<dynamic-cluster-setting,dynamic cluster settings>>.
  7. [[cluster-update-settings-api-request]]
  8. ==== {api-request-title}
  9. `PUT /_cluster/settings`
  10. [[cluster-update-settings-api-prereqs]]
  11. ==== {api-prereq-title}
  12. * If the {es} {security-features} are enabled, you must have the `manage`
  13. <<privileges-list-cluster,cluster privilege>> to use this API.
  14. [[cluster-update-settings-api-desc]]
  15. ==== {api-description-title}
  16. :strip-api-link: true
  17. include::{es-repo-dir}/setup/configuration.asciidoc[tag=cluster-setting-precedence]
  18. [[cluster-update-settings-api-query-params]]
  19. ==== {api-query-parms-title}
  20. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  21. `include_defaults`::
  22. (Optional, Boolean) If `true`, returns all default cluster settings.
  23. Defaults to `false`.
  24. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  25. [[cluster-update-settings-api-example]]
  26. ==== {api-examples-title}
  27. An example of a persistent update:
  28. [source,console]
  29. --------------------------------------------------
  30. PUT /_cluster/settings
  31. {
  32. "persistent" : {
  33. "indices.recovery.max_bytes_per_sec" : "50mb"
  34. }
  35. }
  36. --------------------------------------------------
  37. An example of a transient update:
  38. // tag::transient-settings-warning[]
  39. [WARNING]
  40. ====
  41. We no longer recommend using transient cluster settings. Use persistent cluster
  42. settings instead. If a cluster becomes unstable, transient settings can clear
  43. unexpectedly, resulting in a potentially undesired cluster configuration. See
  44. the <<transient-settings-migration-guide>>.
  45. ====
  46. // end::transient-settings-warning[]
  47. [source,console]
  48. --------------------------------------------------
  49. PUT /_cluster/settings?flat_settings=true
  50. {
  51. "transient" : {
  52. "indices.recovery.max_bytes_per_sec" : "20mb"
  53. }
  54. }
  55. --------------------------------------------------
  56. The response to an update returns the changed setting, as in this response to
  57. the transient example:
  58. [source,console-result]
  59. --------------------------------------------------
  60. {
  61. ...
  62. "persistent" : { },
  63. "transient" : {
  64. "indices.recovery.max_bytes_per_sec" : "20mb"
  65. }
  66. }
  67. --------------------------------------------------
  68. // TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
  69. This example resets a setting:
  70. [source,console]
  71. --------------------------------------------------
  72. PUT /_cluster/settings
  73. {
  74. "transient" : {
  75. "indices.recovery.max_bytes_per_sec" : null
  76. }
  77. }
  78. --------------------------------------------------
  79. The response does not include settings that have been reset:
  80. [source,console-result]
  81. --------------------------------------------------
  82. {
  83. ...
  84. "persistent" : {},
  85. "transient" : {}
  86. }
  87. --------------------------------------------------
  88. // TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
  89. You can also reset settings using wildcards. For example, to reset
  90. all dynamic `indices.recovery` settings:
  91. [source,console]
  92. --------------------------------------------------
  93. PUT /_cluster/settings
  94. {
  95. "transient" : {
  96. "indices.recovery.*" : null
  97. }
  98. }
  99. --------------------------------------------------