local-export.asciidoc 4.9 KB

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