get-desired-balance.asciidoc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. "roles": ["data_content"],
  96. "shard_count": 10,
  97. "forecast_write_load": 8.5,
  98. "forecast_disk_usage_bytes": 498435,
  99. "actual_disk_usage_bytes": 498435
  100. },
  101. "node-2": {
  102. "node_id": "bgC66tboTIeFQ0VgRGI4Gg",
  103. "roles": ["data_content"],
  104. "shard_count": 15,
  105. "forecast_write_load": 3.25,
  106. "forecast_disk_usage_bytes": 384935,
  107. "actual_disk_usage_bytes": 384935
  108. },
  109. "node-3": {
  110. "node_id": "2x1VTuSOQdeguXPdN73yRw",
  111. "roles": ["data_content"],
  112. "shard_count": 12,
  113. "forecast_write_load": 6.0,
  114. "forecast_disk_usage_bytes": 648766,
  115. "actual_disk_usage_bytes": 648766
  116. }
  117. }
  118. },
  119. "routing_table": {
  120. "test": {
  121. "0": {
  122. "current": [
  123. {
  124. "state": "STARTED",
  125. "primary": true,
  126. "node": "UPYt8VwWTt-IADAEbqpLxA",
  127. "node_is_desired": true,
  128. "relocating_node": null,
  129. "relocating_node_is_desired": null,
  130. "shard_id": 0,
  131. "index": "test",
  132. "forecast_write_load": 8.0,
  133. "forecast_shard_size_in_bytes": 1024,
  134. "tier_preference": ["data_content"]
  135. }
  136. ],
  137. "desired": {
  138. "node_ids": [
  139. "UPYt8VwWTt-IADAEbqpLxA"
  140. ],
  141. "total": 1,
  142. "unassigned": 0,
  143. "ignored": 0
  144. }
  145. },
  146. "1": {
  147. "current": [
  148. {
  149. "state": "STARTED",
  150. "primary": true,
  151. "node": "2x1VTuSOQdeguXPdN73yRw",
  152. "node_is_desired": true,
  153. "relocating_node": null,
  154. "relocating_node_is_desired": false,
  155. "shard_id": 1,
  156. "index": "test",
  157. "forecast_write_load": null,
  158. "forecast_shard_size_in_bytes": null,
  159. "tier_preference": ["data_content"]
  160. }
  161. ],
  162. "desired": {
  163. "node_ids": [
  164. "2x1VTuSOQdeguXPdN73yRw"
  165. ],
  166. "total": 1,
  167. "unassigned": 0,
  168. "ignored": 0
  169. }
  170. }
  171. }
  172. },
  173. "cluster_info" : {
  174. "nodes" : {
  175. "UPYt8VwWTt-IADAEbqpLxA" : {
  176. "node_name" : "node-1",
  177. "least_available" : {
  178. "path" : "/data",
  179. "total_bytes" : 1440713945,
  180. "used_bytes" : 1222486407,
  181. "free_bytes" : 218227538,
  182. "free_disk_percent" : 15.1,
  183. "used_disk_percent" : 84.9
  184. },
  185. "most_available" : {
  186. "path" : "/data",
  187. "total_bytes" : 1440713945,
  188. "used_bytes" : 1222486407,
  189. "free_bytes" : 218227538,
  190. "free_disk_percent" : 15.1,
  191. "used_disk_percent" : 84.9
  192. }
  193. }
  194. },
  195. "shard_sizes" : {
  196. "[test][0][p]_bytes" : 1720826288,
  197. "[test][1][p]_bytes" : 1720826288
  198. },
  199. "shard_data_set_sizes" : {
  200. "[test][0][p]_bytes" : 1720826288,
  201. "[test][1][p]_bytes" : 1720826288
  202. },
  203. "shard_paths" : {
  204. "NodeAndShard[nodeId=UPYt8VwWTt-IADAEbqpLxA, shardId=[test][0]]" : "/data",
  205. "NodeAndShard[nodeId=bgC66tboTIeFQ0VgRGI4Gg, shardId=[test][0]]" : "/data"
  206. },
  207. "reserved_sizes" : []
  208. }
  209. }
  210. --------------------------------------------------
  211. // TEST[skip:Can't reliably test desired balance]