production.asciidoc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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.
  7. // tag::monitoring-rec[]
  8. [IMPORTANT]
  9. =========================
  10. {agent} and {metricbeat} are the recommended methods for collecting and shipping
  11. monitoring data to a monitoring cluster.
  12. If you have previously configured legacy collection methods, you should migrate
  13. to using <<configuring-elastic-agent,{agent}>> or
  14. <<configuring-metricbeat,{metricbeat}>> collection. Do not use legacy collection
  15. alongside other collection methods.
  16. =========================
  17. // end::monitoring-rec[]
  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. * Ideally the monitoring cluster and the production cluster run on the same
  29. {stack} version. However, a monitoring cluster on the latest release of
  30. {major-version} also works with production clusters that use the same major
  31. version. Monitoring clusters that use {major-version} also work with production
  32. clusters that use the latest release of {prev-major-version}.
  33. * There must be at least one <<ingest,ingest node>> in the monitoring
  34. cluster; it does not need to be a dedicated ingest node.
  35. ===============================
  36. --
  37. .. (Optional) Verify that the collection of monitoring data is disabled on the
  38. monitoring cluster. By default, the `xpack.monitoring.collection.enabled` setting
  39. is `false`.
  40. +
  41. --
  42. For example, you can use the following APIs to review and change this setting:
  43. [source,console]
  44. ----------------------------------
  45. GET _cluster/settings
  46. PUT _cluster/settings
  47. {
  48. "persistent": {
  49. "xpack.monitoring.collection.enabled": false
  50. }
  51. }
  52. ----------------------------------
  53. // TEST[skip:security errs]
  54. --
  55. .. If the {es} {security-features} are enabled on the monitoring cluster, create
  56. users that can send and retrieve monitoring data:
  57. +
  58. --
  59. NOTE: If you plan to use {kib} to view monitoring data, username and password
  60. credentials must be valid on both the {kib} server and the monitoring cluster.
  61. --
  62. *** If you plan to use {agent},
  63. create a user that has the `remote_monitoring_collector`
  64. <<built-in-roles-remote-monitoring-agent,built-in role>>.
  65. *** If you plan to use {metricbeat},
  66. create a user that has the `remote_monitoring_collector` built-in role and a
  67. user that has the `remote_monitoring_agent`
  68. <<built-in-roles-remote-monitoring-agent,built-in role>>. Alternatively, use the
  69. `remote_monitoring_user` <<built-in-users,built-in user>>.
  70. *** If you plan to use HTTP exporters to route data through your production
  71. cluster, create a user that has the `remote_monitoring_agent`
  72. <<built-in-roles-remote-monitoring-agent,built-in role>>.
  73. +
  74. --
  75. For example, the
  76. following request creates a `remote_monitor` user that has the
  77. `remote_monitoring_agent` role:
  78. [source,console]
  79. ---------------------------------------------------------------
  80. POST /_security/user/remote_monitor
  81. {
  82. "password" : "changeme",
  83. "roles" : [ "remote_monitoring_agent"],
  84. "full_name" : "Internal Agent For Remote Monitoring"
  85. }
  86. ---------------------------------------------------------------
  87. // TEST[skip:needs-gold+-license]
  88. Alternatively, use the `remote_monitoring_user` <<built-in-users,built-in user>>.
  89. --
  90. . Configure your production cluster to collect data and send it to the
  91. monitoring cluster:
  92. ** <<configuring-elastic-agent,{agent} collection methods>>
  93. ** <<configuring-metricbeat,{metricbeat} collection methods>>
  94. ** <<collecting-monitoring-data,Legacy collection methods>>
  95. . (Optional)
  96. {logstash-ref}/configuring-logstash.html[Configure {ls} to collect data and send it to the monitoring cluster].
  97. . (Optional) {enterprise-search-ref}/monitoring.html[Configure {ents} monitoring].
  98. . (Optional) Configure the {beats} to collect data and send it to the monitoring
  99. cluster. Skip this step for {beats} that are managed by {agent}.
  100. ** {auditbeat-ref}/monitoring.html[Auditbeat]
  101. ** {filebeat-ref}/monitoring.html[Filebeat]
  102. ** {heartbeat-ref}/monitoring.html[Heartbeat]
  103. ** {metricbeat-ref}/monitoring.html[Metricbeat]
  104. ** {packetbeat-ref}/monitoring.html[Packetbeat]
  105. ** {winlogbeat-ref}/monitoring.html[Winlogbeat]
  106. . (Optional) {apm-guide-ref}/monitor-apm.html[Configure APM Server monitoring]
  107. . (Optional) Configure {kib} to collect data and send it to the monitoring cluster:
  108. ** {kibana-ref}/monitoring-elastic-agent.html[{agent} collection methods]
  109. ** {kibana-ref}/monitoring-metricbeat.html[{metricbeat} collection methods]
  110. ** {kibana-ref}/monitoring-kibana.html[Legacy collection methods]
  111. . (Optional) Create a dedicated {kib} instance for monitoring, rather than using
  112. a single {kib} instance to access both your production cluster and monitoring
  113. cluster.
  114. +
  115. --
  116. NOTE: If you log in to {kib} using SAML, Kerberos, PKI, OpenID Connect, or token
  117. authentication providers, a dedicated {kib} instance is *required*. The security
  118. tokens that are used in these contexts are cluster-specific; therefore you
  119. cannot use a single {kib} instance to connect to both production and monitoring
  120. clusters.
  121. --
  122. .. (Optional) Disable the collection of monitoring data in this {kib} instance.
  123. Set the `xpack.monitoring.kibana.collection.enabled` setting to `false` in the
  124. `kibana.yml` file. For more information about this setting, see
  125. {kibana-ref}/monitoring-settings-kb.html[Monitoring settings in {kib}].
  126. . {kibana-ref}/monitoring-data.html[Configure {kib} to retrieve and display the monitoring data].