Search...::Nodes(3pm)

πŸ“¦
version 6.81 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Search...::Nodes πŸ’–

okay bestie, so this is Search...::Nodes, from the Search::Elasticsearch::Client::1_0::Direct::Nodes module β€” it's the perl manpage (3pm section, iykyk) and it's literally your little bestie for talking to nodes. πŸ¦‹


🌸 VERSION

version 6.81 β€” yes ma'am, we're on 6.81.


πŸ’… DESCRIPTION

This module is the plug for making node-level requests β€” think pulling node info, node stats, all that cute stuff. πŸŽ€

It does Search::Elasticsearch::Role::Client::Direct β€” that's its whole personality.


πŸ‘‘ METHODS

✨ info()

$response = $e->nodes->info(
    node_id => $node_id | \@node_ids       # optional
    metric  => $metric  | \@metrics        # optional
);

So info() hands you the static information about the nodes in your cluster β€” the boring-but-essential tea, like the configured max number of file handles, the max configured heap size, or the threadpool settings. no cap, it's useful. πŸ’–

Allowed metrics are:

"http",
"jvm",
"network",
"os",
"plugin",
"process",
"settings",
"thread_pool",
"transport"

Query string parameters:

"flat_settings",
"human"

See the node_info docs <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html> for more information.


🌈 stats()

$response = $e->nodes->stats(
    node_id      => $node_id    | \@node_ids       # optional
    metric       => $metric     | \@metrics        # optional
    index_metric => $ind_metric | \@ind_metrics    # optional
);

stats() is the glow-up version β€” it gives you statistics about your cluster's nodes: how many file handles are open right now, current heap memory usage, how many threads are in use. the numbers. the vibes. πŸ“Š

You can get stats for all the nodes, or just some of them by passing the node_id parameter. And by default you get all the metrics back β€” but you can narrow it down to just the ones in the metric parameter.

Allowed metrics are:

"_all",
"breaker",
"fs",
"http",
"indices",
"jvm",
"network",
"os",
"process",
"thread_pool",
"transport"

If you ask for the indices metric (or _all), then it's giving indices_stats information on a per-node basis. Which indices stats come back is up to you, bestie β€” control it with the index_metric parameter:

$response = $e->cluster->node_stats(
    node_id       => 'node_1',
    metric        => ['indices','fs']
    index_metric  => ['docs','fielddata']
);

Allowed index metrics are:

"_all",
"completion"
"docs",
"fielddata",
"filter_cache",
"flush",
"get",
"id_cache",
"indexing",
"merge",
"percolate",
"query_cache",
"refresh",
"search",
"segments",
"store",
"warmer"

Query string parameters:

"completion_fields",
"fielddata_fields",
"fields",
"groups",
"human",
"level",
"types"

See the node_stats docs <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html> for more information.


πŸ”₯ hot_threads()

$response = $e->nodes->hot_threads(
    node_id => $node_id | \@node_ids       # optional
)

When a node is being too much, hot_threads() is the diagnostic tool you want. 🫢 It literally takes a snapshot of which threads are eating the most CPU β€” a real "who's doing the most right now" moment.

Query string parameters:

"ignore_idle_threads",
"interval",
"snapshots",
"threads",
"type"

See the hot_threads docs <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html> for more information.


πŸ’€ shutdown()

$e->nodes->shutdown(
    node_id => $node_id | \@node_ids    # optional
);

shutdown() is the main character exit β€” it shuts down one or more nodes, or the entire cluster. yes, the whole thing. 😭

Query string parameters:

"delay",
"exit"
⚠️ bestie, this is shutting down nodes. be so serious when you call this one.

See the shutdown docs <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html> for more information.


πŸŽ€ AUTHOR

Enrico Zimuel <enrico.zimuel@elastic.co> β€” ty for your service, icon. πŸ‘‘


This software is Copyright (c) 2020 by Elasticsearch BV.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

okay that's the whole page, you ate it up fr fr. this was Search...::Nodes(3pm) β€” perl v5.36.0, dated 2022-08-28 πŸ¦‹πŸ’– mwah, go make some node requests bestie ✨

πŸ“¦ where this page comes from