local-export.asciidoc 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[local-exporter]]
  4. === Local exporters
  5. [IMPORTANT]
  6. =========================
  7. {metricbeat} is the recommended method for collecting and shipping monitoring
  8. data to a monitoring cluster.
  9. If you have previously configured internal collection, you should migrate to
  10. using {metricbeat} collection. Use either {metricbeat} collection or
  11. internal collection; do not use both.
  12. Learn more about <<configuring-metricbeat>>.
  13. =========================
  14. The `local` exporter is the default exporter in {monitoring}. It routes data
  15. back into the same (local) cluster. In other words, it uses the production
  16. cluster as the monitoring cluster. For example:
  17. [source,yaml]
  18. ---------------------------------------------------
  19. xpack.monitoring.exporters.my_local_exporter: <1>
  20. type: local
  21. ---------------------------------------------------
  22. <1> The exporter name uniquely defines the exporter, but it is otherwise unused.
  23. This exporter exists to provide a convenient option when hardware is simply not
  24. available. It is also a way for developers to get an idea of what their actions
  25. do for pre-production clusters when they do not have the time or resources to
  26. provide a separate monitoring cluster. However, this exporter has disadvantages
  27. that impact the local cluster:
  28. * All indexing impacts the local cluster and the nodes that hold the monitoring
  29. indices' shards.
  30. * Most collectors run on the elected master node. Therefore most indexing occurs
  31. with the elected master node as the coordinating node, which is a bad practice.
  32. * Any usage of {monitoring} for {kib} uses the local cluster's resources for
  33. searches and aggregations, which means that they might not be available for
  34. non-monitoring tasks.
  35. * If the local cluster goes down, the monitoring cluster has inherently gone
  36. down with it (and vice versa), which generally defeats the purpose of monitoring.
  37. For the `local` exporter, all setup occurs only on the elected master node. This
  38. means that if you do not see any monitoring templates or ingest pipelines, the
  39. elected master node is having issues or it is not configured in the same way.
  40. Unlike the `http` exporter, the `local` exporter has the advantage of accessing
  41. the monitoring cluster's up-to-date cluster state. It can therefore always check
  42. that the templates and ingest pipelines exist without a performance penalty. If
  43. the elected master node encounters errors while trying to create the monitoring
  44. resources, it logs errors, ignores that collection, and tries again after the
  45. next collection.
  46. The elected master node is the only node to set up resources for the `local`
  47. exporter. Therefore all other nodes wait for the resources to be set up before
  48. indexing any monitoring data from their own collectors. Each of these nodes logs
  49. a message indicating that they are waiting for the resources to be set up.
  50. One benefit of the `local` exporter is that it lives within the cluster and
  51. therefore no extra configuration is required when the cluster is secured with
  52. {stack} {security-features}. All operations, including indexing operations, that
  53. occur from a `local` exporter make use of the internal transport mechanisms
  54. within {es}. This behavior enables the exporter to be used without providing any
  55. user credentials when {security-features} are enabled.
  56. For more information about the configuration options for the `local` exporter,
  57. see <<local-exporter-settings>>.
  58. [[local-exporter-cleaner]]
  59. ==== Cleaner service
  60. One feature of the `local` exporter, which is not present in the `http` exporter,
  61. is a cleaner service. The cleaner service runs once per day at 01:00 AM UTC on
  62. the elected master node.
  63. The role of the cleaner service is to clean, or curate, the monitoring indices
  64. that are older than a configurable amount of time (the default is `7d`). This
  65. cleaner exists as part of the `local` exporter as a safety mechanism. The `http`
  66. exporter does not make use of it because it could enable a single misconfigured
  67. node to prematurely curate data from other production clusters that share the
  68. same monitoring cluster.
  69. In a dedicated monitoring cluster, the cleaning service can be used without
  70. having to also monitor the monitoring cluster. For example:
  71. [source,yaml]
  72. ---------------------------------------------------
  73. xpack.monitoring.collection.enabled: false <1>
  74. xpack.monitoring.history.duration: 3d <2>
  75. ---------------------------------------------------
  76. <1> Disable the collection of data on the monitoring cluster.
  77. <2> Lower the default history duration from `7d` to `3d`. The minimum value is
  78. `1d`. This setting can be modified only when using a Gold or higher level
  79. license. For the Basic license level, it uses the default of 7 days.