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