• 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
    
    • 1
    • 2

    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"
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    二进制文件部署

    下载地址:
    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:
      -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.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44

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

  • 相关阅读:
    SpringBoot中的上传文件接口
    [Flask]Pycharm+Flask零基础项目搭建入门
    leetcode数学思想
    计算机毕业设计选题推荐-家庭理财微信小程序/安卓APP-项目实战
    软件开发工程师谈测试金字塔实践
    护士人文修养测试题答案
    JVM-五大区
    【Android Jetpack】Hilt的理解与浅析
    Unity 跑酷游戏全部脚本(完结)
    前端 CSS 经典:多行文本擦除效果
  • 原文地址:https://blog.csdn.net/m0_67401660/article/details/126360068