update-settings.asciidoc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. [[cluster-update-settings]]
  2. == Cluster Update Settings
  3. Allows to update cluster wide specific settings. Settings updated can
  4. either be persistent (applied cross restarts) or transient (will not
  5. survive a full cluster restart). Here is an example:
  6. [source,js]
  7. --------------------------------------------------
  8. curl -XPUT localhost:9200/_cluster/settings -d '{
  9. "persistent" : {
  10. "discovery.zen.minimum_master_nodes" : 2
  11. }
  12. }'
  13. --------------------------------------------------
  14. Or:
  15. [source,js]
  16. --------------------------------------------------
  17. curl -XPUT localhost:9200/_cluster/settings -d '{
  18. "transient" : {
  19. "discovery.zen.minimum_master_nodes" : 2
  20. }
  21. }'
  22. --------------------------------------------------
  23. The cluster responds with the settings updated. So the response for the
  24. last example will be:
  25. [source,js]
  26. --------------------------------------------------
  27. {
  28. "persistent" : {},
  29. "transient" : {
  30. "discovery.zen.minimum_master_nodes" : "2"
  31. }
  32. }'
  33. --------------------------------------------------
  34. Resetting persistent or transient settings can be done by assigning a
  35. `null` value. If a transient setting is reset, the persistent setting
  36. is applied if available. Otherwise Elasticsearch will fallback to the setting
  37. defined at the configuration file or, if not existent, to the default
  38. value. Here is an example:
  39. [source,js]
  40. --------------------------------------------------
  41. curl -XPUT localhost:9200/_cluster/settings -d '{
  42. "transient" : {
  43. "discovery.zen.minimum_master_nodes" : null
  44. }
  45. }'
  46. --------------------------------------------------
  47. Reset settings will not be included in the cluster response. So
  48. the response for the last example will be:
  49. [source,js]
  50. --------------------------------------------------
  51. {
  52. "persistent" : {},
  53. "transient" : {}
  54. }
  55. Cluster wide settings can be returned using:
  56. [source,js]
  57. --------------------------------------------------
  58. curl -XGET localhost:9200/_cluster/settings
  59. --------------------------------------------------
  60. A list of dynamically updatable settings can be found in the
  61. <<modules,Modules>> documentation.