master.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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-prereqs]]
  12. ==== {api-prereq-title}
  13. * If the {es} {security-features} are enabled, you must have the `monitor` or
  14. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  15. [[cat-master-api-query-params]]
  16. ==== {api-query-parms-title}
  17. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=http-format]
  18. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-h]
  19. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=help]
  20. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  21. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  22. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-s]
  23. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
  24. [[cat-master-api-example]]
  25. ==== {api-examples-title}
  26. [source,console]
  27. --------------------------------------------------
  28. GET /_cat/master?v=true
  29. --------------------------------------------------
  30. The API returns the following response:
  31. [source,txt]
  32. --------------------------------------------------
  33. id host ip node
  34. YzWoH_2BT-6UjVGDyPdqYg 127.0.0.1 127.0.0.1 YzWoH_2
  35. --------------------------------------------------
  36. // TESTRESPONSE[s/YzWoH_2.+/.+/ non_json]
  37. This information is also available via the `nodes` command, but this
  38. is slightly shorter when all you want to do, for example, is verify
  39. all nodes agree on the master:
  40. [source,sh]
  41. --------------------------------------------------
  42. % pssh -i -h list.of.cluster.hosts curl -s localhost:9200/_cat/master
  43. [1] 19:16:37 [SUCCESS] es3.vm
  44. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  45. [2] 19:16:37 [SUCCESS] es2.vm
  46. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  47. [3] 19:16:37 [SUCCESS] es1.vm
  48. Ntgn2DcuTjGuXlhKDUD4vA 192.168.56.30 H5dfFeA
  49. --------------------------------------------------
  50. // NOTCONSOLE