cluster.asciidoc 4.1 KB

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