1Search::Elasticsearch::UCsleSireeanCrtoc:nh:t:7r:_iE0bl:ua:tsDetidircePsceetra:lr:cCDhlo:uc:suCtmleeirne(tn3at)t:i:o7n_0::Direct::Cluster(3)
2
3
4
6 Search::Elasticsearch::Client::7_0::Direct::Cluster - A client for
7 running cluster-level requests
8
10 version 7.30
11
13 This module provides methods to make cluster-level requests, such as
14 getting and setting cluster-level settings, manually rerouting shards,
15 and retrieving for monitoring purposes.
16
17 It does Search::Elasticsearch::Role::Client::Direct.
18
20 "health()"
21 $response = $e->cluster->health(
22 index => 'index' | \@indices # optional
23 );
24
25 The "health()" method is used to retrieve information about the cluster
26 health, returning "red", "yellow" or "green" to indicate the state of
27 the cluster, indices or shards.
28
29 Query string parameters:
30 "error_trace",
31 "human",
32 "level",
33 "local",
34 "master_timeout",
35 "timeout",
36 "wait_for_active_shards",
37 "wait_for_events",
38 "wait_for_no_initializing_shards",
39 "wait_for_no_relocating_shards",
40 "wait_for_nodes",
41 "wait_for_status"
42
43 See the cluster health docs
44 <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
45 health.html> for more information.
46
47 "stats()"
48 $response = $e->cluster->stats(
49 node_id => 'node' | \@nodes # optional
50 );
51
52 Returns high-level cluster stats, optionally limited to the listed
53 nodes.
54
55 Query string parameters:
56 "error_trace",
57 "flat_settings",
58 "human",
59 "timeout"
60
61 See the cluster stats docs
62 <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
63 stats.html> for more information.
64
65 "get_settings()"
66 $response = $e->cluster->get_settings()
67
68 The "get_settings()" method is used to retrieve cluster-wide settings
69 that have been set with the "put_settings()" method.
70
71 Query string parameters:
72 "error_trace",
73 "flat_settings",
74 "human",
75 "include_defaults",
76 "master_timeout",
77 "timeout"
78
79 See the cluster settings docs
80 <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
81 update-settings.html> for more information.
82
83 "put_settings()"
84 $response = $e->cluster->put_settings( %settings );
85
86 The "put_settings()" method is used to set cluster-wide settings,
87 either transiently (which don't survive restarts) or permanently (which
88 do survive restarts).
89
90 For instance:
91
92 $response = $e->cluster->put_settings(
93 body => {
94 transient => { "discovery.zen.minimum_master_nodes" => 6 }
95 }
96 );
97
98 Query string parameters:
99 "error_trace",
100 "flat_settings",
101 "human"
102
103 See the cluster settings docs
104 <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
105 update-settings.html>
106 for more information.
107
108 "state()"
109 $response = $e->cluster->state(
110 metric => $metric | \@metrics # optional
111 index => $index | \@indices # optional
112 );
113
114 The "state()" method returns the current cluster state from the master
115 node, or from the responding node if "local" is set to "true".
116
117 It returns all metrics by default, but these can be limited to any of:
118 "_all",
119 "blocks",
120 "metadata",
121 "nodes",
122 "routing_table"
123
124 Metrics for indices can be limited to particular indices with the
125 "index" parameter.
126
127 Query string parameters:
128 "allow_no_indices",
129 "error_trace",
130 "expand_wildcards",
131 "flat_settings",
132 "human",
133 "ignore_unavailable",
134 "local",
135 "master_timeout",
136 "wait_for_metadata_version",
137 "wait_for_timeout"
138
139 See the cluster state docs
140 <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
141 state.html> for more information.
142
143 "allocation_explain()"
144 $response = $e->cluster->allocation_explain(
145 body => { ... shard selectors ...} # optional
146 );
147
148 Returns information about why a shard is allocated or unallocated or
149 why.
150
151 Query string parameters:
152 "error_trace",
153 "human",
154 "include_disk_info",
155 "include_yes_decisions"
156
157 See the cluster allocation explain docs
158 <https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
159 allocation-explain.html> for more information.
160
161 "pending_tasks()"
162 $response = $e->cluster->pending_tasks();
163
164 Returns a list of cluster-level tasks still pending on the master node.
165
166 Query string parameters:
167 "error_trace",
168 "human",
169 "local",
170 "master_timeout"
171
172 See the pending tasks docs
173 <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
174 pending.html> for more information.
175
176 "reroute()"
177 $e->cluster->reroute(
178 body => { commands }
179 );
180
181 The "reroute()" method is used to manually reallocate shards from one
182 node to another. The "body" should contain the "commands" indicating
183 which changes should be made. For instance:
184
185 $e->cluster->reroute(
186 body => {
187 commands => [
188 { move => {
189 index => 'test',
190 shard => 0,
191 from_node => 'node_1',
192 to_node => 'node_2
193 }},
194 { allocate => {
195 index => 'test',
196 shard => 1,
197 node => 'node_3'
198 }}
199 ]
200 }
201 );
202
203 Query string parameters:
204 "dry_run",
205 "error_trace",
206 "explain",
207 "human",
208 "master_timeout",
209 "metric",
210 "retry_failed",
211 "timeout"
212
213 See the reroute docs
214 <http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
215 reroute.html> for more information.
216
217 "remote_info()"
218 $response = $e->cluster->remote_info();
219
220 The "remote_info()" API retrieves all of the configured remote cluster
221 information.
222
223 Query string parameters:
224 "error_trace",
225 "human"
226
227 See the remote_info docs
228 <https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-
229 remote-info.html> for more information.
230
232 Enrico Zimuel <enrico.zimuel@elastic.co>
233
235 This software is Copyright (c) 2020 by Elasticsearch BV.
236
237 This is free software, licensed under:
238
239 The Apache License, Version 2.0, January 2004
240
241
242
243perl v5.34.0 Search::El2a0s2t1i-c0s7e-a2r2ch::Client::7_0::Direct::Cluster(3)