production.asciidoc 4.4 KB

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