Search...Cluster(3pm)
Search...Cluster(3pm) π
okay bestie, welcome to the manual page for Search::Elasticsearch::Client::2_0::Direct::Cluster β a whole module that's literally just your backstage pass to all the cluster-level drama going on in Elasticsearch. it's the Search...Cluster(3pm) page, and yes we're doing this, sit down, hydrate, let's go π«Ά
β¨ NAME β¨
Search::Elasticsearch::Client::2_0::Direct::Cluster β a client for running cluster-level requests. it's giving main character, it's giving I talk to the whole cluster at once π
πΈ VERSION πΈ
version 6.81
π¦ DESCRIPTION π¦
this module hands you the methods to make cluster-level requests, like:
- getting and setting cluster-level settings
- manually rerouting shards (yes, moving them around by hand, iconic)
- retrieving stuff for monitoring purposes
It does Search::Elasticsearch::Role::Client::Direct. that's the whole vibe.
π METHODS π
π health()
$response = $e->cluster->health(
index => 'index' | \@indices # optional
);
health() is your vibe check for the whole cluster β it pulls back info about cluster health and returns red, yellow or green so you know the state of the cluster, the indices, or the shards. green = slay, yellow = hmm, red = π.
Query string parameters:
levellocalmaster_timeouttimeoutwait_for_active_shardswait_for_nodeswait_for_relocating_shardswait_for_status
for more info, check the cluster health docs at http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html β¨
π stats()
$response = $e->cluster->stats(
node_id => 'node' | \@nodes # optional
);
returns high-level cluster stats, and if you want you can limit it to just the nodes you list. lowkey a whole dashboard in one call.
Query string parameters:
flat_settingshumantimeout
for more info, check the cluster stats docs at http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html π
π get_settings()
$response = $e->cluster->get_settings()
get_settings() retrieves the cluster-wide settings β specifically the ones that got set by the put_settings() method. it's the read half of the duo, fr fr.
Query string parameters:
flat_settingsmaster_timeouttimeout
for more info, check the cluster settings docs at http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html π§
β put_settings()
$response = $e->cluster->put_settings( %settings );
put_settings() sets cluster-wide settings, and you've got two flavours bestie:
- transiently β which don't survive restarts π
- permanently β which do survive restarts π
for instance:
$response = $e->cluster->put_settings(
body => {
transient => { "discovery.zen.minimum_master_nodes" => 5 }
}
);
Query string parameters:
flat_settings
for more info, check the cluster settings docs at http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html πΈ
π₯ state()
$response = $e->cluster->state(
metric => $metric | \@metrics # optional
index => $index | \@indices # optional
);
state() returns the current cluster state from the master node β or from the responding node instead, if local is set to true. plot twist energy.
it returns all metrics by default, but you can limit them to any of:
_allblocksmetadatanodesrouting_table
and metrics for indices can be limited to particular indices with the index parameter. so much control, obsessed.
Query string parameters:
allow_no_indicesexpand_wildcardsflat_settingsignore_unavailablelocalmaster_timeout
for more info, check the cluster state docs at http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html π
π pending_tasks()
$response = $e->cluster->pending_tasks();
returns a list of cluster-level tasks that are still pending on the master node. it's the "girl what is taking so long" method, no cap.
Query string parameters:
localmaster_timeout
for more info, check the pending tasks docs at http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html π
π¦ reroute()
$e->cluster->reroute(
body => { commands }
);
reroute() is for manually reallocating shards from one node to another. the body should contain the commands saying which changes should be made. for instance:
$e->cluster->reroute(
body => {
commands => [
{ move => {
index => 'test',
shard => 0,
from_node => 'node_1',
to_node => 'node_2
}},
{ allocate => {
index => 'test',
shard => 1,
node => 'node_3'
}}
]
}
);
Query string parameters:
dry_runexplainmaster_timeoutmetrictimeout
for more info, check the reroute docs at http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html β¨
π AUTHOR π
Enrico Zimuel <enrico.zimuel@elastic.co> β an actual legend, we thank them for their service π«Ά
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2020 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's the whole page bestie!! this one's running on perl v5.32.0, dated 2020-11-25, and that's the Search...Cluster(3pm) moment π
β¨ bye ily, go check your cluster health π
π¦ where this page comes from
- debian bookworm: libsearch-elasticsearch-client-2-0-perl 6.81-1 Β· Apache-2.0
- debian trixie: libsearch-elasticsearch-client-2-0-perl 6.81-1 Β· Apache-2.0
- ubuntu jammy: libsearch-elasticsearch-client-2-0-perl 6.81-1 Β· Apache-2.0
- ubuntu noble: libsearch-elasticsearch-client-2-0-perl 6.81-1 Β· Apache-2.0
- ubuntu resolute: libsearch-elasticsearch-client-2-0-perl 6.81-1 Β· Apache-2.0
- ubuntu stonking: libsearch-elasticsearch-client-2-0-perl 6.81-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms