production.asciidoc 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. [role="xpack"]
  2. [[monitoring-production]]
  3. == Monitoring in a production environment
  4. In production, you should send monitoring data to a separate _monitoring cluster_
  5. so that historical data is available even when the nodes you are monitoring are
  6. not. For example, you can use {metricbeat} to ship monitoring data about {kib},
  7. {es}, {ls}, and Beats to the monitoring cluster.
  8. If you are sending your data to the {esms-init}, see <<esms>>.
  9. [IMPORTANT]
  10. =========================
  11. {metricbeat} is the recommended method for collecting and shipping monitoring
  12. data to a monitoring cluster.
  13. If you have previously configured legacy collection methods, you should migrate
  14. to using {metricbeat} collection. Use either {metricbeat} collection or
  15. legacy collection methods; do not use both.
  16. Learn more about <<configuring-metricbeat>>.
  17. =========================
  18. If you have at least a Gold Subscription, using a dedicated monitoring cluster
  19. also enables you to monitor multiple clusters from a central location.
  20. To store monitoring data in a separate cluster:
  21. . Set up the {es} cluster you want to use as the monitoring cluster.
  22. For example, you might set up a two host cluster with the nodes `es-mon-1` and
  23. `es-mon-2`.
  24. +
  25. --
  26. [IMPORTANT]
  27. ===============================
  28. * To monitor an {es} {major-version} cluster, you must run {es} {major-version}
  29. on the monitoring cluster.
  30. * There must be at least one <<ingest,ingest node>> in the monitoring
  31. cluster; it does not need to be a dedicated ingest node.
  32. ===============================
  33. --
  34. .. (Optional) Verify that the collection of monitoring data is disabled on the
  35. monitoring cluster. By default, the `xpack.monitoring.collection.enabled` setting
  36. is `false`.
  37. +
  38. --
  39. For example, you can use the following APIs to review and change this setting:
  40. [source,console]
  41. ----------------------------------
  42. GET _cluster/settings
  43. PUT _cluster/settings
  44. {
  45. "persistent": {
  46. "xpack.monitoring.collection.enabled": false
  47. }
  48. }
  49. ----------------------------------
  50. // TEST[skip:security errs]
  51. --
  52. .. If the {es} {security-features} are enabled on the monitoring cluster, create
  53. users that can send and retrieve monitoring data.
  54. +
  55. --
  56. NOTE: If you plan to use {kib} to view monitoring data, username and password
  57. credentials must be valid on both the {kib} server and the monitoring cluster.
  58. --
  59. *** If you plan to use {metricbeat} to collect data about {es} or {kib},
  60. create a user that has the `remote_monitoring_collector` built-in role and a
  61. user that has the `remote_monitoring_agent`
  62. <<built-in-roles-remote-monitoring-agent,built-in role>>. Alternatively, use the
  63. `remote_monitoring_user` <<built-in-users,built-in user>>.
  64. *** If you plan to use HTTP exporters to route data through your production
  65. cluster, create a user that has the `remote_monitoring_agent`
  66. <<built-in-roles-remote-monitoring-agent,built-in role>>.
  67. +
  68. --
  69. For example, the
  70. following request creates a `remote_monitor` user that has the
  71. `remote_monitoring_agent` role:
  72. [source,console]
  73. ---------------------------------------------------------------
  74. POST /_security/user/remote_monitor
  75. {
  76. "password" : "changeme",
  77. "roles" : [ "remote_monitoring_agent"],
  78. "full_name" : "Internal Agent For Remote Monitoring"
  79. }
  80. ---------------------------------------------------------------
  81. // TEST[skip:needs-gold+-license]
  82. Alternatively, use the `remote_monitoring_user` <<built-in-users,built-in user>>.
  83. --
  84. . Configure your production cluster to collect data and send it to the
  85. monitoring cluster:
  86. ** <<configuring-metricbeat,{metricbeat} collection methods>>
  87. ** <<collecting-monitoring-data,Legacy collection methods>>
  88. . (Optional)
  89. {logstash-ref}/configuring-logstash.html[Configure {ls} to collect data and send it to the monitoring cluster].
  90. . (Optional) Configure the Beats to collect data and send it to the monitoring
  91. cluster.
  92. ** {auditbeat-ref}/monitoring.html[Auditbeat]
  93. ** {filebeat-ref}/monitoring.html[Filebeat]
  94. ** {heartbeat-ref}/monitoring.html[Heartbeat]
  95. ** {metricbeat-ref}/monitoring.html[Metricbeat]
  96. ** {packetbeat-ref}/monitoring.html[Packetbeat]
  97. ** {winlogbeat-ref}/monitoring.html[Winlogbeat]
  98. . (Optional) Configure {kib} to collect data and send it to the monitoring cluster:
  99. ** {kibana-ref}/monitoring-metricbeat.html[{metricbeat} collection methods]
  100. ** {kibana-ref}/monitoring-kibana.html[Legacy collection methods]
  101. . (Optional) Create a dedicated {kib} instance for monitoring, rather than using
  102. a single {kib} instance to access both your production cluster and monitoring
  103. cluster.
  104. +
  105. --
  106. NOTE: If you log in to {kib} using SAML, Kerberos, PKI, OpenID Connect, or token
  107. authentication providers, a dedicated {kib} instance is *required*. The security
  108. tokens that are used in these contexts are cluster-specific, therefore you
  109. cannot use a single {kib} instance to connect to both production and monitoring
  110. clusters.
  111. --
  112. .. (Optional) Disable the collection of monitoring data in this {kib} instance.
  113. Set the `xpack.monitoring.kibana.collection.enabled` setting to `false` in the
  114. `kibana.yml` file. For more information about this setting, see
  115. {kibana-ref}/monitoring-settings-kb.html[Monitoring settings in {kib}].
  116. . {kibana-ref}/monitoring-data.html[Configure {kib} to retrieve and display the monitoring data].