production.asciidoc 5.3 KB

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