master.asciidoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. [[cat-master]]
  2. === cat master API
  3. ++++
  4. <titleabbrev>cat master</titleabbrev>
  5. ++++
  6. [IMPORTANT]
  7. ====
  8. cat APIs are only intended for human consumption using the command line or {kib}
  9. console. They are _not_ intended for use by applications. For application
  10. consumption, use the <<cluster-nodes-info,nodes info API>>.
  11. ====
  12. Returns information about the master node, including the ID, bound IP address,
  13. and name.
  14. [[cat-master-api-request]]
  15. ==== {api-request-title}
  16. `GET /_cat/master`
  17. [[cat-master-api-prereqs]]
  18. ==== {api-prereq-title}
  19. * If the {es} {security-features} are enabled, you must have the `monitor` or
  20. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  21. [[cat-master-api-query-params]]
  22. ==== {api-query-parms-title}
  23. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=http-format]
  24. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-h]
  25. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=help]
  26. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  27. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  28. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-s]
  29. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
  30. [[cat-master-api-example]]
  31. ==== {api-examples-title}
  32. [source,console]
  33. --------------------------------------------------
  34. GET /_cat/master?v=true
  35. --------------------------------------------------
  36. The API returns the following response:
  37. [source,txt]
  38. --------------------------------------------------
  39. id host ip node
  40. YzWoH_2BT-6UjVGDyPdqYg 127.0.0.1 127.0.0.1 YzWoH_2
  41. --------------------------------------------------
  42. // TESTRESPONSE[s/YzWoH_2.+/.+/ non_json]
  43. This information is also available via the `nodes` command, but this
  44. is slightly shorter when all you want to do, for example, is verify
  45. all nodes agree on the master:
  46. [source,sh]
  47. --------------------------------------------------
  48. % pssh -i -h list.of.cluster.hosts curl -s localhost:9200/_cat/master
  49. [1] 19:16:37 [SUCCESS] es3.vm
  50. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  51. [2] 19:16:37 [SUCCESS] es2.vm
  52. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  53. [3] 19:16:37 [SUCCESS] es1.vm
  54. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  55. --------------------------------------------------
  56. // NOTCONSOLE