elasticsearch-exporter部署手册

elasticsearch-exporter部署手册

来源

https://github.com/prometheus-community/elasticsearch_exporter

说明

用于 ElasticSearch 的各种指标的 Prometheus 导出器,由 Go 语言编写。
导出器在每次抓取时从 ElasticSearch 集群中获取信息,因此抓取间隔太短会给 ES 主节点带来负载,尤其是当您使用 --es.all 和 --es.indices 运行时。 我们建议您测量 ES 集群获取 /_nodes/stats 和 /_all/_stats 所需的时间,以确定您的抓取间隔是否太短。 作为最后的手段,您可以使用具有自己的抓取间隔的专用作业抓取此导出器。

部署方式:

docker部署

docker pull quay.io/prometheuscommunity/elasticsearch-exporter:latest
docker run --rm -p 9114:9114 quay.io/prometheuscommunity/elasticsearch-exporter:latest

Example docker-compose.yml:

elasticsearch_exporter:
    image: quay.io/prometheuscommunity/elasticsearch-exporter:latest
    command:
     - '--es.uri=http://elasticsearch:9200'
    restart: always
    ports:
    - "127.0.0.1:9114:9114"

二进制文件部署

下载地址:
https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.2.1/elasticsearch_exporter-1.2.1.linux-amd64.tar.gz

解压进入目标文件夹后执行./elasticsearch_exporter --help可查看所有配置项;

usage: elasticsearch_exporter [<flags>]

Flags:
  -h, --help                 Show context-sensitive help (also try --help-long
                             and --help-man).
      --web.listen-address=":9114"
                             Address to listen on for web interface and
                             telemetry.
      --web.telemetry-path="/metrics"
                             Path under which to expose metrics.
      --es.uri="http://localhost:9200"
                             HTTP API address of an Elasticsearch node.
      --es.timeout=5s        Timeout for trying to get stats from Elasticsearch.
      --es.all               Export stats for all nodes in the cluster. If used,
                             this flag will override the flag es.node.
      --es.node="_local"     Node's name of which metrics should be exposed.
      --es.indices           Export stats for indices in the cluster.
      --es.indices_settings  Export stats for settings of all indices of the
                             cluster.
      --es.indices_mappings  Export stats for mappings of all indices of the
                             cluster.
      --es.cluster_settings  Export stats for cluster settings.
      --es.shards            Export stats for shards in the cluster (implies
                             --es.indices).
      --es.snapshots         Export stats for the cluster snapshots.
      --es.clusterinfo.interval=5m
                             Cluster info update interval for the cluster label
      --es.ca=""             Path to PEM file that contains trusted Certificate
                             Authorities for the Elasticsearch connection.
      --es.client-private-key=""
                             Path to PEM file that contains the private key for
                             client auth when connecting to Elasticsearch.
      --es.client-cert=""    Path to PEM file that contains the corresponding
                             cert for the private key to connect to
                             Elasticsearch.
      --es.ssl-skip-verify   Skip SSL verification when connecting to
                             Elasticsearch.
      --log.level="info"     Sets the loglevel. Valid levels are debug, info,
                             warn, error
      --log.format="logfmt"  Sets the log format. Valid formats are json and
                             logfmt
      --log.output="stdout"  Sets the log output. Valid outputs are stdout and
                             stderr
      --version              Show application version.

根据自己的需求拼接参数;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值