cluster.asciidoc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. [[cluster]]
  2. == Cluster APIs
  3. .New API reference
  4. [sidebar]
  5. --
  6. For the most up-to-date API details, refer to {api-es}/group/endpoint-cluster[Cluster APIs].
  7. --
  8. ["float",id="cluster-nodes"]
  9. === Node specification
  10. Some cluster-level APIs may operate on a subset of the nodes which can be
  11. specified with _node filters_. For example, the <<tasks,Task Management>>,
  12. <<cluster-nodes-stats,Nodes Stats>>, and <<cluster-nodes-info,Nodes Info>> APIs
  13. can all report results from a filtered set of nodes rather than from all nodes.
  14. _Node filters_ are written as a comma-separated list of individual filters,
  15. each of which adds or removes nodes from the chosen subset. Each filter can be
  16. one of the following:
  17. * `_all`, to add all nodes to the subset.
  18. * `_local`, to add the local node to the subset.
  19. * `_master`, to add the currently-elected master node to the subset.
  20. * a node id or name, to add this node to the subset.
  21. * an IP address or hostname, to add all matching nodes to the subset.
  22. * a pattern, using `*` wildcards, which adds all nodes to the subset
  23. whose name, address or hostname matches the pattern.
  24. * `master:true`, `data:true`, `ingest:true`, `voting_only:true`, `ml:true`, or
  25. `coordinating_only:true`, which respectively add to the subset all
  26. master-eligible nodes, all data nodes, all ingest nodes, all voting-only
  27. nodes, all machine learning nodes, and all coordinating-only nodes.
  28. * `master:false`, `data:false`, `ingest:false`, `voting_only:false`, `ml:false`,
  29. or `coordinating_only:false`, which respectively remove from the subset all
  30. master-eligible nodes, all data nodes, all ingest nodes, all voting-only
  31. nodes, all machine learning nodes, and all coordinating-only nodes.
  32. * a pair of patterns, using `*` wildcards, of the form `attrname:attrvalue`,
  33. which adds to the subset all nodes with a custom node attribute whose name
  34. and value match the respective patterns. Custom node attributes are
  35. configured by setting properties in the configuration file of the form
  36. `node.attr.attrname: attrvalue`.
  37. NOTE: node filters run in the order in which they are given, which is important
  38. if using filters that remove nodes from the set. For example
  39. `_all,master:false` means all the nodes except the master-eligible ones, but
  40. `master:false,_all` means the same as `_all` because the `_all` filter runs
  41. after the `master:false` filter.
  42. NOTE: if no filters are given, the default is to select all nodes. However, if
  43. any filters are given then they run starting with an empty chosen subset. This
  44. means that filters such as `master:false` which remove nodes from the chosen
  45. subset are only useful if they come after some other filters. When used on its
  46. own, `master:false` selects no nodes.
  47. Here are some examples of the use of node filters with the
  48. <<cluster-nodes-info,Nodes Info>> APIs.
  49. [source,console]
  50. --------------------------------------------------
  51. # If no filters are given, the default is to select all nodes
  52. GET /_nodes
  53. # Explicitly select all nodes
  54. GET /_nodes/_all
  55. # Select just the local node
  56. GET /_nodes/_local
  57. # Select the elected master node
  58. GET /_nodes/_master
  59. # Select nodes by name, which can include wildcards
  60. GET /_nodes/node_name_goes_here
  61. GET /_nodes/node_name_goes_*
  62. # Select nodes by address, which can include wildcards
  63. GET /_nodes/10.0.0.3,10.0.0.4
  64. GET /_nodes/10.0.0.*
  65. # Select nodes by role
  66. GET /_nodes/_all,master:false
  67. GET /_nodes/data:true,ingest:true
  68. GET /_nodes/coordinating_only:true
  69. GET /_nodes/master:true,voting_only:false
  70. # Select nodes by custom attribute (e.g. with something like `node.attr.rack: 2` in the configuration file)
  71. GET /_nodes/rack:2
  72. GET /_nodes/ra*:2
  73. GET /_nodes/ra*:2*
  74. --------------------------------------------------
  75. include::cluster/allocation-explain.asciidoc[]
  76. include::cluster/get-settings.asciidoc[]
  77. include::cluster/health.asciidoc[]
  78. include::health/health.asciidoc[]
  79. include::cluster/reroute.asciidoc[]
  80. include::cluster/state.asciidoc[]
  81. include::cluster/stats.asciidoc[]
  82. include::cluster/update-settings.asciidoc[]
  83. include::cluster/nodes-usage.asciidoc[]
  84. include::cluster/nodes-hot-threads.asciidoc[]
  85. include::cluster/nodes-info.asciidoc[]
  86. include::cluster/prevalidate-node-removal.asciidoc[]
  87. include::cluster/nodes-reload-secure-settings.asciidoc[]
  88. include::cluster/nodes-stats.asciidoc[]
  89. include::cluster/cluster-info.asciidoc[]
  90. include::cluster/pending.asciidoc[]
  91. include::cluster/remote-info.asciidoc[]
  92. include::cluster/tasks.asciidoc[]
  93. include::cluster/voting-exclusions.asciidoc[]
  94. include::cluster/update-desired-nodes.asciidoc[]
  95. include::cluster/get-desired-nodes.asciidoc[]
  96. include::cluster/delete-desired-nodes.asciidoc[]
  97. include::cluster/get-desired-balance.asciidoc[]
  98. include::cluster/delete-desired-balance.asciidoc[]