1
0

update-desired-nodes.asciidoc 4.2 KB

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