New

The executive guide to generative AI

Read more

Elasticsearch 模块

编辑

elasticsearch 模块收集关于 Elasticsearch 的指标。

兼容性

编辑

elasticsearch 模块适用于 Elasticsearch 6.7.0 及更高版本。

用于 Elastic Stack 监控

编辑

elasticsearch 模块可用于收集在 Kibana 的 Stack Monitoring UI 中显示的指标。要启用此用法,请设置 xpack.enabled: true 并从模块的配置中删除任何 metricsets。或者,运行 metricbeat modules disable elasticsearchmetricbeat modules enable elasticsearch-xpack

启用 xpack 模式后,默认情况下会自动启用所有旧的指标集。这意味着您无需手动启用它们,并且不会有冲突或问题,因为 Metricbeat 会将用户定义的指标集与 xpack 模式强制启用的指标集合并。因此,您可以无缝地收集全面的指标,而无需担心数据集重叠或重复。

metricbeat.modules:
- module: elasticsearch
  xpack.enabled: true
  metricsets:
    - ingest_pipeline
  period: 10s

当此模块用于 Elastic Stack 监控时,它会将指标发送到监控索引,而不是 Metricbeat 通常使用的默认索引。有关监控索引的更多详细信息,请参阅 配置监控索引

模块特定配置说明

编辑

与其他 Metricbeat 模块一样,elasticsearch 模块接受 hosts 配置设置。此设置可以包含一个条目列表。相关的 scope 设置决定模块如何解释 hosts 列表中的每个条目。

  • 如果 scope 设置为 node(默认),则 hosts 列表中的每个条目都表示 Elasticsearch 集群中的一个不同节点。
  • 如果 scope 设置为 cluster,则 hosts 列表中的每个条目都表示一个不同 Elasticsearch 集群的单个端点(例如,集群前面的负载均衡代理)。

配置示例

Elasticsearch 模块支持 模块 中描述的标准配置选项。这是一个配置示例

metricbeat.modules:
- module: elasticsearch
  metricsets:
    - node
    - node_stats
    #- index
    #- index_recovery
    #- index_summary
    #- ingest_pipeline
    #- shard
    #- ml_job
  period: 10s
  hosts: ["https://127.0.0.1:9200"]
  #username: "elastic"
  #password: "changeme"
  #api_key: "foo:bar"
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  #index_recovery.active_only: true
  #ingest_pipeline.processor_sample_rate: 0.25
  #xpack.enabled: false
  #scope: node

当使用 ssl 配置字段时,此模块支持 TLS 连接,如 SSL 中所述。它还支持 标准 HTTP 配置选项中描述的选项。

指标集

以下指标集可用

Was this helpful?
Feedback