2013-11-15 09:14:39 +08:00
|
|
|
[[cat-master]]
|
2019-08-13 20:35:08 +08:00
|
|
|
=== cat master API
|
|
|
|
++++
|
|
|
|
<titleabbrev>cat master</titleabbrev>
|
|
|
|
++++
|
2013-11-15 09:14:39 +08:00
|
|
|
|
2019-08-07 21:03:31 +08:00
|
|
|
Returns information about the master node, including the ID, bound IP address,
|
|
|
|
and name.
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-master-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`GET /_cat/master`
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-master-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-master-api-example]]
|
|
|
|
==== {api-examples-title}
|
2013-11-15 09:14:39 +08:00
|
|
|
|
2019-09-10 01:13:41 +08:00
|
|
|
[source,console]
|
2013-11-15 09:14:39 +08:00
|
|
|
--------------------------------------------------
|
2016-10-14 04:42:21 +08:00
|
|
|
GET /_cat/master?v
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-08-07 21:03:31 +08:00
|
|
|
The API returns the following response:
|
2016-10-14 04:42:21 +08:00
|
|
|
|
2016-10-25 22:56:30 +08:00
|
|
|
[source,txt]
|
2016-10-14 04:42:21 +08:00
|
|
|
--------------------------------------------------
|
|
|
|
id host ip node
|
|
|
|
YzWoH_2BT-6UjVGDyPdqYg 127.0.0.1 127.0.0.1 YzWoH_2
|
2013-11-15 09:14:39 +08:00
|
|
|
--------------------------------------------------
|
2019-06-10 21:33:32 +08:00
|
|
|
// TESTRESPONSE[s/YzWoH_2.+/.+/ non_json]
|
2013-11-15 09:14:39 +08:00
|
|
|
|
|
|
|
This information is also available via the `nodes` command, but this
|
|
|
|
is slightly shorter when all you want to do, for example, is verify
|
|
|
|
all nodes agree on the master:
|
|
|
|
|
2015-07-15 00:14:09 +08:00
|
|
|
[source,sh]
|
2013-11-15 09:14:39 +08:00
|
|
|
--------------------------------------------------
|
|
|
|
% pssh -i -h list.of.cluster.hosts curl -s localhost:9200/_cat/master
|
|
|
|
[1] 19:16:37 [SUCCESS] es3.vm
|
2016-09-16 20:32:03 +08:00
|
|
|
Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
|
2013-11-15 09:14:39 +08:00
|
|
|
[2] 19:16:37 [SUCCESS] es2.vm
|
2016-09-16 20:32:03 +08:00
|
|
|
Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
|
2013-11-15 09:14:39 +08:00
|
|
|
[3] 19:16:37 [SUCCESS] es1.vm
|
2016-09-16 20:32:03 +08:00
|
|
|
Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
|
2013-11-15 09:14:39 +08:00
|
|
|
--------------------------------------------------
|
2016-10-14 04:42:21 +08:00
|
|
|
// NOTCONSOLE
|