-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs for cluster API #30468
Update docs for cluster API #30468
Conversation
Add docs for some missing node filters.
Pinging @elastic/es-core-infra |
docs/reference/cluster.asciidoc
Outdated
the APIs either using their internal node id, the node name, address, | ||
custom attributes, or just the `_local` node receiving the request. For | ||
example, here are some sample executions of nodes info: | ||
Most cluster level APIs allow to specify nodes (for example, getting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add something to sentence to explain that specifying nodes limits the results to those nodes? At least, I think that is what specifying the node does here, but I'm no expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More examples is good, but I think we need a more detailed description of the logic in DiscoveryNodes#resolveNodes()
too: it's a comma-separated list of selectors, where each selector is:
_local
_master
_all
- a node id or name or IP address or hostname
- a pattern (containing
*
wildcards) that matches node name/IP/hostname attr:value
whereattr
andvalue
are patterns (containing*
wildcards) that match node attributes and values- the filters
{master,data,ingest,coordinating_only}:{true,false}
which add/remove the selected nodes from the current set.
The selectors run in order: the {master,data,ingest,coordinating_only}:false
options means that order is sometimes important.
Also, +1 to @nik9000's comment: I also think it'd be good to describe the effects of specifying a set of nodes in more detail.
docs/reference/cluster.asciidoc
Outdated
GET /_nodes/node_name_goes_here | ||
GET /_nodes/node_name_goes_* | ||
# Attributes (set something like node.attr.rack: 2 in the config) | ||
# Using built-in attributes (master, data, ingest or coordinating_only) | ||
GET /_nodes/master:false,data:false,ingest:true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is equivalent to the simpler GET /_nodes/ingest:true
so I don't think we should have this.
Hi @nik9000 @DaveCTurner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a minor thing. @DaveCTurner, what do you think?
docs/reference/cluster.asciidoc
Outdated
custom attributes, or just the `_local` node receiving the request. For | ||
example, here are some sample executions of nodes info: | ||
Most cluster level APIs allow to specify nodes with `node filters`, these filters | ||
limit the results to selected nodes for corresponding APIs.(For example, you can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a space after the .
and before the (
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few more comments. I think we need to be a bit more precise in some places still, and there's some formatting nits.
More generally I'm wondering if this would be better-off moving to the common options section, with corresponding updates to the links.
docs/reference/cluster.asciidoc
Outdated
Most cluster level APIs allow to specify nodes with `node filters`, these filters | ||
limit the results to selected nodes for corresponding APIs. (For example, you can | ||
find it in APIs like `Cluster State`, `Task Management` and all the Nodes API like | ||
`Nodes States`, `Nodes Info` etc.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that most cluster-level APIs allow us to specify a set of nodes - by my reckoning it's these:
- Cluster Stats (via the (undocumented?)
?nodeId=
parameter - could also do with fixing) - Nodes Stats
- Nodes Info
- Nodes Feature Usage
- Task Management API
- Nodes hot_threads
There are 13 subheadings in this section, and 6/13 is less than half. (I haven't dug through the code to confirm this so my numbers could be off). In any case it might not be more than half in future, so I think I'd prefer "some" to "most".
Also the things in backticks
in this paragraph are not code so I don't think they should be formatted like this. The ones that refer to other pages would be better as links, and node filters
is introducing a piece of terminology which we seem either to put in italics or else "in double quotes" depending on taste.
Also also Nodes States
should probably be Nodes Stats
, and the cluster state API doesn't seem to support a node filter as stated here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's right, the Cluster Stats
API doesn't support node filters, in fact we can only add /nodes
to filter the nodes
part of the response but no further filtering for that.
Thanks so much for your review @nik9000 and @DaveCTurner, I address it and for moving to |
Hi @PnPie, sorry for the radio silence recently. This is still on my radar.
I'm inclined to agree. Let's leave it as it is now. I started out on a review with some suggested wording fixes but it got quite long and I decided it'd be simpler to make the changes on the branch itself. I merged |
Hi @DaveCTurner |
There's been substantial changes since this review. Please could you take another look?
@elasticmachine test this please |
@nik9000 could you give this a final check as it changed substantially since your approving review? |
ping @nik9000 can you check this one please? |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a minor comment (probably just because I got a little confused), looks good otherwise.
docs/reference/cluster.asciidoc
Outdated
* `_local`, to add the local node to the subset. | ||
* `_master`, to add the currently-elected master node to the subset. | ||
* a node id, to add this node to the set. | ||
* a pattern, using `*` wildcards, which adds all nodes to the subset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this a little bit confusing. It suggests that name, address, or hostname will only be resolved when using wildcards. Maybe change the previous entry (a node id) to say a node id, node name, address or hostname to add the node with the corresponding id, name, address or hostname to the set
to reinforce that exact matching also works.
Good point, thanks. A pattern with no @elasticmachine test this please, one last time 🤞 |
Expands and clarifies exactly what is and isn't allowed when specifying a subset of the nodes as targets of a cluster API, and adds missing links to this from the hot threads and cluster stats API docs. Co-authored-by: David Turner <david.turner@elastic.co> Co-authored-by: Yu <yu.liu003@gmail.com>
Expands and clarifies exactly what is and isn't allowed when specifying a subset of the nodes as targets of a cluster API, and adds missing links to this from the hot threads and cluster stats API docs. Co-authored-by: David Turner <david.turner@elastic.co> Co-authored-by: Yu <yu.liu003@gmail.com>
Expands and clarifies exactly what is and isn't allowed when specifying a subset of the nodes as targets of a cluster API, and adds missing links to this from the hot threads and cluster stats API docs. Co-authored-by: David Turner <david.turner@elastic.co> Co-authored-by: Yu <yu.liu003@gmail.com>
* master: Generalize remote license checker (#32971) Trim translog when safe commit advanced (#32967) Fix an inaccuracy in the dynamic templates documentation. (#32890) Logging: Use settings when building daemon threads (#32751) All Translog inner closes should happen after tragedy exception is set (#32674) HLREST: AwaitsFix ML Test Pass DiscoveryNode to initiateChannel (#32958) Add mzn and dz to unsupported locales (#32957) Use settings from the context in BootstrapChecks (#32908) Update docs for node specifications (#30468) HLRC: Forbid all Elasticsearch logging infra (#32784) Only configure publishing if it's applied externally (#32351) Fixes libs:dissect when in eclipse Protect ScriptedMetricIT test cases against failures on 0-doc shards (#32959) (#32968) [Kerberos] Add documentation for Kerberos realm (#32662) Watcher: Properly find next valid date in cron expressions (#32734) Fix some small issues in the getting started docs (#30346) Set forbidden APIs target compatibility to compiler java version (#32935) Move connection listener to ConnectionManager (#32956)
…e-types * elastic/master: (89 commits) Fix assertion in AbstractSimpleTransportTestCase (elastic#32991) [DOC] Splits role mapping APIs into separate pages (elastic#32797) HLRC: ML Close Job (elastic#32943) Generalize remote license checker (elastic#32971) Trim translog when safe commit advanced (elastic#32967) Fix an inaccuracy in the dynamic templates documentation. (elastic#32890) Logging: Use settings when building daemon threads (elastic#32751) All Translog inner closes should happen after tragedy exception is set (elastic#32674) HLREST: AwaitsFix ML Test Pass DiscoveryNode to initiateChannel (elastic#32958) Add mzn and dz to unsupported locales (elastic#32957) Use settings from the context in BootstrapChecks (elastic#32908) Update docs for node specifications (elastic#30468) HLRC: Forbid all Elasticsearch logging infra (elastic#32784) Only configure publishing if it's applied externally (elastic#32351) Fixes libs:dissect when in eclipse Protect ScriptedMetricIT test cases against failures on 0-doc shards (elastic#32959) (elastic#32968) [Kerberos] Add documentation for Kerberos realm (elastic#32662) Watcher: Properly find next valid date in cron expressions (elastic#32734) Fix some small issues in the getting started docs (elastic#30346) ...
Expands and clarifies exactly what is and isn't allowed when specifying a subset of the nodes as targets of a cluster API, and adds missing links to this from the hot threads and cluster stats API docs. Co-authored-by: David Turner <david.turner@elastic.co> Co-authored-by: Yu <yu.liu003@gmail.com>
* commit '9088d811ce9cff922e6ef1befbeb0f1e0c27016a': (23 commits) Generalize remote license checker (elastic#32971) Trim translog when safe commit advanced (elastic#32967) Fix an inaccuracy in the dynamic templates documentation. (elastic#32890) HLREST: AwaitsFix ML Test Make Geo Context Mapping Parsing More Strict (elastic#32862) Add mzn and dz to unsupported locales (elastic#32957) Use settings from the context in BootstrapChecks (elastic#32908) Update docs for node specifications (elastic#30468) HLRC: Forbid all Elasticsearch logging infra (elastic#32784) Fix use of deprecated apis Only configure publishing if it's applied externally (elastic#32351) Protect ScriptedMetricIT test cases against failures on 0-doc shards (elastic#32959) (elastic#32968) Scripted metric aggregations: add deprecation warning and system (elastic#32944) Watcher: Properly find next valid date in cron expressions (elastic#32734) Fix some small issues in the getting started docs (elastic#30346) Set forbidden APIs target compatibility to compiler java version (elastic#32935) [TEST] Add "ne" as an unsupported SimpleKdc locale (elastic#32700) MINOR: Remove `IndexTemplateFilter` (elastic#32841) (elastic#32974) INGEST: Create Index Before Pipeline Execute (elastic#32786) (elastic#32975) NETWORKING: Make RemoteClusterConn. Lazy Resolve DNS (elastic#32764) (elastic#32976) ...
What about this for node filters update ?
Relates to #30455