get-desired-balance.asciidoc 6.5 KB

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