master.asciidoc 2.4 KB

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