希望するバランスAPI

この機能は、Elasticsearch ServiceElastic Cloud Enterprise、およびElastic Cloud on Kubernetesによる間接的な使用のために設計されています。直接の使用はサポートされていません。

公開内容:

  • 希望するバランスの計算と調整統計
  • シャードの分布、ノードおよびデータ層全体のディスクおよびインジェスト予測などのバランス統計(現在のクラスター状態に基づく)
  • 各シャードの現在の位置と希望する位置を示すルーティングテーブル
  • ノードのディスク使用量を含むクラスター情報

リクエスト

Python

  1. resp = client.perform_request(
  2. "GET",
  3. "/_internal/desired_balance",
  4. )
  5. print(resp)

Js

  1. const response = await client.transport.request({
  2. method: "GET",
  3. path: "/_internal/desired_balance",
  4. });
  5. console.log(response);

コンソール

  1. GET /_internal/desired_balance

APIは以下の結果を返します:

コンソール-結果

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