cluster.asciidoc 4.1 KB

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