2019-09-27 17:58:10 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[[monitoring-production]]
|
|
|
|
== Monitoring in a production environment
|
|
|
|
|
|
|
|
In production, you should send monitoring data to a separate _monitoring cluster_
|
|
|
|
so that historical data is available even when the nodes you are monitoring are
|
|
|
|
not. For example, you can use {metricbeat} to ship monitoring data about {kib},
|
|
|
|
{es}, {ls}, and Beats to the monitoring cluster.
|
2020-06-11 13:16:53 -04:00
|
|
|
If you are sending your data to the {esms-init}, see <<esms>>.
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
[IMPORTANT]
|
|
|
|
=========================
|
|
|
|
{metricbeat} is the recommended method for collecting and shipping monitoring
|
|
|
|
data to a monitoring cluster.
|
|
|
|
|
2020-06-11 13:16:53 -04:00
|
|
|
If you have previously configured legacy collection methods, you should migrate
|
|
|
|
to using {metricbeat} collection. Use either {metricbeat} collection or
|
|
|
|
legacy collection methods; do not use both.
|
2019-12-02 16:31:47 -05:00
|
|
|
|
|
|
|
Learn more about <<configuring-metricbeat>>.
|
|
|
|
=========================
|
|
|
|
|
2020-06-11 13:16:53 -04:00
|
|
|
If you have at least a Gold Subscription, using a dedicated monitoring cluster
|
|
|
|
also enables you to monitor multiple clusters from a central location.
|
2019-09-27 17:58:10 -04:00
|
|
|
|
|
|
|
To store monitoring data in a separate cluster:
|
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
. Set up the {es} cluster you want to use as the monitoring cluster.
|
|
|
|
For example, you might set up a two host cluster with the nodes `es-mon-1` and
|
2019-09-27 17:58:10 -04:00
|
|
|
`es-mon-2`.
|
|
|
|
+
|
|
|
|
--
|
|
|
|
[IMPORTANT]
|
|
|
|
===============================
|
|
|
|
* To monitor an {es} {major-version} cluster, you must run {es} {major-version}
|
|
|
|
on the monitoring cluster.
|
|
|
|
* There must be at least one <<ingest,ingest node>> in the monitoring
|
|
|
|
cluster; it does not need to be a dedicated ingest node.
|
|
|
|
===============================
|
|
|
|
--
|
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
.. (Optional) Verify that the collection of monitoring data is disabled on the
|
|
|
|
monitoring cluster. By default, the `xpack.monitoring.collection.enabled` setting
|
|
|
|
is `false`.
|
|
|
|
+
|
2019-09-27 17:58:10 -04:00
|
|
|
--
|
|
|
|
For example, you can use the following APIs to review and change this setting:
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
----------------------------------
|
|
|
|
GET _cluster/settings
|
|
|
|
|
|
|
|
PUT _cluster/settings
|
|
|
|
{
|
|
|
|
"persistent": {
|
|
|
|
"xpack.monitoring.collection.enabled": false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----------------------------------
|
2019-09-27 20:10:03 -04:00
|
|
|
// TEST[skip:security errs]
|
2019-09-27 17:58:10 -04:00
|
|
|
--
|
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
.. If the {es} {security-features} are enabled on the monitoring cluster, create
|
|
|
|
users that can send and retrieve monitoring data.
|
2019-09-27 17:58:10 -04:00
|
|
|
+
|
|
|
|
--
|
2019-12-02 16:31:47 -05:00
|
|
|
NOTE: If you plan to use {kib} to view monitoring data, username and password
|
|
|
|
credentials must be valid on both the {kib} server and the monitoring cluster.
|
2019-09-27 17:58:10 -04:00
|
|
|
|
|
|
|
--
|
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
*** If you plan to use {metricbeat} to collect data about {es} or {kib},
|
|
|
|
create a user that has the `remote_monitoring_collector` built-in role and a
|
|
|
|
user that has the `remote_monitoring_agent`
|
|
|
|
<<built-in-roles-remote-monitoring-agent,built-in role>>. Alternatively, use the
|
|
|
|
`remote_monitoring_user` <<built-in-users,built-in user>>.
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
*** If you plan to use HTTP exporters to route data through your production
|
|
|
|
cluster, create a user that has the `remote_monitoring_agent`
|
|
|
|
<<built-in-roles-remote-monitoring-agent,built-in role>>.
|
2019-09-27 17:58:10 -04:00
|
|
|
+
|
|
|
|
--
|
2019-12-02 16:31:47 -05:00
|
|
|
For example, the
|
|
|
|
following request creates a `remote_monitor` user that has the
|
2019-09-27 17:58:10 -04:00
|
|
|
`remote_monitoring_agent` role:
|
|
|
|
|
2019-10-04 11:19:10 -04:00
|
|
|
[source,console]
|
2019-09-27 17:58:10 -04:00
|
|
|
---------------------------------------------------------------
|
|
|
|
POST /_security/user/remote_monitor
|
|
|
|
{
|
|
|
|
"password" : "changeme",
|
|
|
|
"roles" : [ "remote_monitoring_agent"],
|
|
|
|
"full_name" : "Internal Agent For Remote Monitoring"
|
|
|
|
}
|
|
|
|
---------------------------------------------------------------
|
|
|
|
// TEST[skip:needs-gold+-license]
|
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
Alternatively, use the `remote_monitoring_user` <<built-in-users,built-in user>>.
|
2019-09-27 17:58:10 -04:00
|
|
|
--
|
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
. Configure your production cluster to collect data and send it to the
|
2020-06-11 13:16:53 -04:00
|
|
|
monitoring cluster:
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2020-06-11 13:16:53 -04:00
|
|
|
** <<configuring-metricbeat,{metricbeat} collection methods>>
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2020-06-11 13:16:53 -04:00
|
|
|
** <<collecting-monitoring-data,Legacy collection methods>>
|
2019-09-27 17:58:10 -04:00
|
|
|
|
|
|
|
. (Optional)
|
|
|
|
{logstash-ref}/configuring-logstash.html[Configure {ls} to collect data and send it to the monitoring cluster].
|
|
|
|
|
|
|
|
. (Optional) Configure the Beats to collect data and send it to the monitoring
|
2019-12-02 16:31:47 -05:00
|
|
|
cluster.
|
2019-09-27 17:58:10 -04:00
|
|
|
** {auditbeat-ref}/monitoring.html[Auditbeat]
|
|
|
|
** {filebeat-ref}/monitoring.html[Filebeat]
|
|
|
|
** {heartbeat-ref}/monitoring.html[Heartbeat]
|
|
|
|
** {metricbeat-ref}/monitoring.html[Metricbeat]
|
|
|
|
** {packetbeat-ref}/monitoring.html[Packetbeat]
|
2019-12-02 16:31:47 -05:00
|
|
|
** {winlogbeat-ref}/monitoring.html[Winlogbeat]
|
2019-09-27 17:58:10 -04:00
|
|
|
|
|
|
|
. (Optional) Configure {kib} to collect data and send it to the monitoring cluster:
|
|
|
|
|
2020-06-11 13:16:53 -04:00
|
|
|
** {kibana-ref}/monitoring-metricbeat.html[{metricbeat} collection methods]
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2020-06-11 13:16:53 -04:00
|
|
|
** {kibana-ref}/monitoring-kibana.html[Legacy collection methods]
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
. (Optional) Create a dedicated {kib} instance for monitoring, rather than using
|
|
|
|
a single {kib} instance to access both your production cluster and monitoring
|
2019-09-27 17:58:10 -04:00
|
|
|
cluster.
|
2020-09-22 12:35:18 -04:00
|
|
|
+
|
|
|
|
--
|
|
|
|
NOTE: If you log in to {kib} using SAML, Kerberos, PKI, OpenID Connect, or token
|
|
|
|
authentication providers, a dedicated {kib} instance is *required*. The security
|
|
|
|
tokens that are used in these contexts are cluster-specific, therefore you
|
|
|
|
cannot use a single {kib} instance to connect to both production and monitoring
|
|
|
|
clusters.
|
|
|
|
|
|
|
|
--
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
.. (Optional) Disable the collection of monitoring data in this {kib} instance.
|
|
|
|
Set the `xpack.monitoring.kibana.collection.enabled` setting to `false` in the
|
|
|
|
`kibana.yml` file. For more information about this setting, see
|
|
|
|
{kibana-ref}/monitoring-settings-kb.html[Monitoring settings in {kib}].
|
2019-09-27 17:58:10 -04:00
|
|
|
|
2019-12-02 16:31:47 -05:00
|
|
|
. {kibana-ref}/monitoring-data.html[Configure {kib} to retrieve and display the monitoring data].
|