1
0

update-desired-nodes.asciidoc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. [[update-desired-nodes]]
  2. === Create or update desired nodes API
  3. ++++
  4. <titleabbrev>Create or update desired nodes</titleabbrev>
  5. ++++
  6. NOTE: {cloud-only}
  7. .New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-cluster[Cluster APIs].
  11. --
  12. Creates or updates the desired nodes.
  13. [[update-desired-nodes-request]]
  14. ==== {api-request-title}
  15. [source,console]
  16. --------------------------------------------------
  17. PUT /_internal/desired_nodes/<history_id>/<version>
  18. {
  19. "nodes" : [
  20. {
  21. "settings" : {
  22. "node.name" : "instance-000187",
  23. "node.external_id": "instance-000187",
  24. "node.roles" : ["data_hot", "master"],
  25. "node.attr.data" : "hot",
  26. "node.attr.logical_availability_zone" : "zone-0"
  27. },
  28. "processors" : 8.0,
  29. "memory" : "58gb",
  30. "storage" : "2tb"
  31. }
  32. ]
  33. }
  34. --------------------------------------------------
  35. // TEST[s/<history_id>/test/]
  36. // TEST[s/<version>/1/]
  37. //////////////////////////
  38. [source,console]
  39. --------------------------------------------------
  40. DELETE /_internal/desired_nodes
  41. --------------------------------------------------
  42. // TEST[continued]
  43. //////////////////////////
  44. [[update-desired-nodes-query-params]]
  45. ==== {api-query-parms-title}
  46. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  47. `dry_run`::
  48. (Optional, Boolean) If `true`, then the request simulates the update and
  49. returns a response with `dry_run` field set to `true`.
  50. [[update-desired-nodes-desc]]
  51. ==== {api-description-title}
  52. This API creates or update the desired nodes. External orchestrators can use
  53. this API to let Elasticsearch know about the cluster topology, including future
  54. changes such as adding or removing nodes. Using this information, the system is
  55. able to take better decisions.
  56. It's possible to run the update in "dry run" mode by adding the
  57. `?dry_run` query parameter. This will validate the request result, but will not actually perform the update.
  58. [[update-desired-nodes-examples]]
  59. ==== {api-examples-title}
  60. In this example, a new version for the desired nodes with history `Ywkh3INLQcuPT49f6kcppA` is created.
  61. This API only accepts monotonically increasing versions.
  62. [source,console]
  63. --------------------------------------------------
  64. PUT /_internal/desired_nodes/Ywkh3INLQcuPT49f6kcppA/100
  65. {
  66. "nodes" : [
  67. {
  68. "settings" : {
  69. "node.name" : "instance-000187",
  70. "node.external_id": "instance-000187",
  71. "node.roles" : ["data_hot", "master"],
  72. "node.attr.data" : "hot",
  73. "node.attr.logical_availability_zone" : "zone-0"
  74. },
  75. "processors" : 8.0,
  76. "memory" : "58gb",
  77. "storage" : "2tb"
  78. }
  79. ]
  80. }
  81. --------------------------------------------------
  82. // TEST
  83. The API returns the following result:
  84. [source,console-result]
  85. --------------------------------------------------
  86. {
  87. "replaced_existing_history_id": false,
  88. "dry_run": false
  89. }
  90. --------------------------------------------------
  91. Additionally, it is possible to specify a processors range.
  92. This is helpful in environments where Elasticsearch nodes can
  93. be deployed in hosts where the number of processors that the
  94. Elasticsearch process can use is guaranteed to be at least the
  95. lower range and up to the upper range. This is a common scenario
  96. in Linux deployments where cgroups is used.
  97. [source,console]
  98. --------------------------------------------------
  99. PUT /_internal/desired_nodes/Ywkh3INLQcuPT49f6kcppA/101
  100. {
  101. "nodes" : [
  102. {
  103. "settings" : {
  104. "node.name" : "instance-000187",
  105. "node.external_id": "instance-000187",
  106. "node.roles" : ["data_hot", "master"],
  107. "node.attr.data" : "hot",
  108. "node.attr.logical_availability_zone" : "zone-0"
  109. },
  110. "processors_range" : {"min": 8.0, "max": 10.0},
  111. "memory" : "58gb",
  112. "storage" : "2tb"
  113. }
  114. ]
  115. }
  116. --------------------------------------------------
  117. //////////////////////////
  118. [source,console]
  119. --------------------------------------------------
  120. DELETE /_internal/desired_nodes
  121. --------------------------------------------------
  122. // TEST[continued]
  123. //////////////////////////