get-desired-balance.asciidoc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. [[get-desired-balance]]
  2. === Get desired balance API
  3. ++++
  4. <titleabbrev>Get desired balance</titleabbrev>
  5. ++++
  6. NOTE: {cloud-only}
  7. Exposes the desired balance and basic metrics.
  8. [[get-desired-balance-request]]
  9. ==== {api-request-title}
  10. [source,console]
  11. --------------------------------------------------
  12. GET /_internal/desired_balance
  13. --------------------------------------------------
  14. // TEST[skip:Can't reliably test desired balance]
  15. The API returns the following result:
  16. [source,console-result]
  17. --------------------------------------------------
  18. {
  19. "stats": {
  20. "computation_active": false,
  21. "computation_submitted": 5,
  22. "computation_executed": 5,
  23. "computation_converged": 5,
  24. "computation_iterations": 4,
  25. "computation_converged_index": 4,
  26. "computation_time_in_millis": 0,
  27. "reconciliation_time_in_millis": 0
  28. },
  29. "cluster_balance_stats" : {
  30. "tiers": {
  31. "data_hot" : {
  32. "shard_count" : {
  33. "total" : 7.0,
  34. "min" : 2.0,
  35. "max" : 3.0,
  36. "average" : 2.3333333333333335,
  37. "std_dev" : 0.4714045207910317
  38. },
  39. "forecast_write_load" : {
  40. "total" : 21.0,
  41. "min" : 6.0,
  42. "max" : 8.5,
  43. "average" : 7.0,
  44. "std_dev" : 1.0801234497346435
  45. },
  46. "forecast_disk_usage" : {
  47. "total" : 36.0,
  48. "min" : 10.0,
  49. "max" : 16.0,
  50. "average" : 12.0,
  51. "std_dev" : 2.8284271247461903
  52. },
  53. "actual_disk_usage" : {
  54. "total" : 36.0,
  55. "min" : 10.0,
  56. "max" : 16.0,
  57. "average" : 12.0,
  58. "std_dev" : 2.8284271247461903
  59. }
  60. },
  61. "data_warm" : {
  62. "shard_count" : {
  63. "total" : 3.0,
  64. "min" : 1.0,
  65. "max" : 1.0,
  66. "average" : 1.0,
  67. "std_dev" : 0.0
  68. },
  69. "forecast_write_load" : {
  70. "total" : 0.0,
  71. "min" : 0.0,
  72. "max" : 0.0,
  73. "average" : 0.0,
  74. "std_dev" : 0.0
  75. },
  76. "forecast_disk_usage" : {
  77. "total" : 42.0,
  78. "min" : 12.0,
  79. "max" : 18.0,
  80. "average" : 14.0,
  81. "std_dev" : 2.8284271247461903
  82. },
  83. "actual_disk_usage" : {
  84. "total" : 42.0,
  85. "min" : 12.0,
  86. "max" : 18.0,
  87. "average" : 14.0,
  88. "std_dev" : 2.8284271247461903
  89. }
  90. }
  91. },
  92. "nodes": {
  93. "node-1": {
  94. "node_id": "UPYt8VwWTt-IADAEbqpLxA",
  95. "shard_count": 10,
  96. "forecast_write_load": 8.5,
  97. "forecast_disk_usage_bytes": 498435,
  98. "actual_disk_usage_bytes": 498435
  99. },
  100. "node-2": {
  101. "node_id": "bgC66tboTIeFQ0VgRGI4Gg",
  102. "shard_count": 15,
  103. "forecast_write_load": 3.25,
  104. "forecast_disk_usage_bytes": 384935,
  105. "actual_disk_usage_bytes": 384935
  106. },
  107. "node-3": {
  108. "node_id": "2x1VTuSOQdeguXPdN73yRw",
  109. "shard_count": 12,
  110. "forecast_write_load": 6.0,
  111. "forecast_disk_usage_bytes": 648766,
  112. "actual_disk_usage_bytes": 648766
  113. }
  114. }
  115. },
  116. "routing_table": {
  117. "test": {
  118. "0": {
  119. "current": [
  120. {
  121. "state": "STARTED",
  122. "primary": true,
  123. "node": "UPYt8VwWTt-IADAEbqpLxA",
  124. "node_is_desired": true,
  125. "relocating_node": null,
  126. "relocating_node_is_desired": false,
  127. "shard_id": 0,
  128. "index": "test",
  129. "forecast_write_load": 8.0,
  130. "forecast_shard_size_in_bytes": 1024
  131. }
  132. ],
  133. "desired": {
  134. "node_ids": [
  135. "UPYt8VwWTt-IADAEbqpLxA"
  136. ],
  137. "total": 1,
  138. "unassigned": 0,
  139. "ignored": 0
  140. }
  141. },
  142. "1": {
  143. "current": [
  144. {
  145. "state": "STARTED",
  146. "primary": true,
  147. "node": "2x1VTuSOQdeguXPdN73yRw",
  148. "node_is_desired": true,
  149. "relocating_node": null,
  150. "relocating_node_is_desired": false,
  151. "shard_id": 1,
  152. "index": "test",
  153. "forecast_write_load": null,
  154. "forecast_shard_size_in_bytes": null
  155. }
  156. ],
  157. "desired": {
  158. "node_ids": [
  159. "2x1VTuSOQdeguXPdN73yRw"
  160. ],
  161. "total": 1,
  162. "unassigned": 0,
  163. "ignored": 0
  164. }
  165. }
  166. }
  167. },
  168. "cluster_info" : {
  169. "nodes" : {
  170. "UPYt8VwWTt-IADAEbqpLxA" : {
  171. "node_name" : "node-1",
  172. "least_available" : {
  173. "path" : "/data",
  174. "total_bytes" : 1440713945,
  175. "used_bytes" : 1222486407,
  176. "free_bytes" : 218227538,
  177. "free_disk_percent" : 15.1,
  178. "used_disk_percent" : 84.9
  179. },
  180. "most_available" : {
  181. "path" : "/data",
  182. "total_bytes" : 1440713945,
  183. "used_bytes" : 1222486407,
  184. "free_bytes" : 218227538,
  185. "free_disk_percent" : 15.1,
  186. "used_disk_percent" : 84.9
  187. }
  188. }
  189. },
  190. "shard_sizes" : {
  191. "[test][0][p]_bytes" : 1720826288,
  192. "[test][1][p]_bytes" : 1720826288
  193. },
  194. "shard_data_set_sizes" : {
  195. "[test][0][p]_bytes" : 1720826288,
  196. "[test][1][p]_bytes" : 1720826288
  197. },
  198. "shard_paths" : {
  199. "NodeAndShard[nodeId=UPYt8VwWTt-IADAEbqpLxA, shardId=[test][0]]" : "/data",
  200. "NodeAndShard[nodeId=bgC66tboTIeFQ0VgRGI4Gg, shardId=[test][0]]" : "/data"
  201. },
  202. "reserved_sizes" : []
  203. }
  204. }
  205. --------------------------------------------------
  206. // TEST[skip:Can't reliably test desired balance]