master.asciidoc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. [[cat-master]]
  2. === cat master API
  3. ++++
  4. <titleabbrev>cat master</titleabbrev>
  5. ++++
  6. Returns information about the master node, including the ID, bound IP address,
  7. and name.
  8. [[cat-master-api-request]]
  9. ==== {api-request-title}
  10. `GET /_cat/master`
  11. [[cat-master-api-query-params]]
  12. ==== {api-query-parms-title}
  13. include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
  14. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
  15. include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
  16. include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
  17. include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  18. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
  19. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
  20. [[cat-master-api-example]]
  21. ==== {api-examples-title}
  22. [source,console]
  23. --------------------------------------------------
  24. GET /_cat/master?v
  25. --------------------------------------------------
  26. The API returns the following response:
  27. [source,txt]
  28. --------------------------------------------------
  29. id host ip node
  30. YzWoH_2BT-6UjVGDyPdqYg 127.0.0.1 127.0.0.1 YzWoH_2
  31. --------------------------------------------------
  32. // TESTRESPONSE[s/YzWoH_2.+/.+/ non_json]
  33. This information is also available via the `nodes` command, but this
  34. is slightly shorter when all you want to do, for example, is verify
  35. all nodes agree on the master:
  36. [source,sh]
  37. --------------------------------------------------
  38. % pssh -i -h list.of.cluster.hosts curl -s localhost:9200/_cat/master
  39. [1] 19:16:37 [SUCCESS] es3.vm
  40. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  41. [2] 19:16:37 [SUCCESS] es2.vm
  42. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  43. [3] 19:16:37 [SUCCESS] es1.vm
  44. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  45. --------------------------------------------------
  46. // NOTCONSOLE