update-desired-nodes.asciidoc 4.0 KB

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