• Prommetheus 插件监控 ES


    转载自:https://blog.csdn.net/u010453363/article/details/76689435/
    用prometheus主要是监控elk中的elasticsearch和logstash
    prometheus的clicent收集数据,并提供http服务,由prometheus server主动pull数据。
     
    1.1 elasticsearch数据由es插件
    实现: https://github.com/vvanholl/elasticsearch-prometheus-exporter
     
    1.1.1 插件下载
    目前试用的是es5.4,https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases 下载对应版本的插件
     
    1.1.2 安装插件
    sh ./bin/elasticsearch-plugin install file:///home/elk/elasticsearch-prometheus-exporter-5.4.0.0.zip ,重启es。
    默认指标目录:http://192.168.x.x:9200/_prometheus/metrics
    http://192.168.x.x:9200/_prometheus/metrics能够看到es的prometheus指标,说明插件安装成功。
     

    1.2配置prometheus server 来pull es数据
    # my global config
    global:
      scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
      evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
      # scrape_timeout is set to the global default (10s).
      # Attach these labels to any time series or alerts when communicating with
      # external systems (federation, remote storage, Alertmanager).
      external_labels:
          monitor: 'codelab-monitor'
    # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
    rule_files:
      # - "first.rules"
      # - "second.rules"
      #  - "prometheus.rules"
    # A scrape configuration containing exactly one endpoint to scrape:
    # Here it's Prometheus itself.
    scrape_configs:
      # es motitor
      - job_name: elasticsearch
        scrape_interval: 10s
        metrics_path: "/_prometheus/metrics"
        static_configs:
          - targets: ['192.168.x.x:9200']
     
    ps:es指标的路径必须为/_prometheus/metrics ,否则prometheus server拉取不到es的指标数据。

    到此 prometheus能够正常展示es指标。
  • 相关阅读:
    String、StringBuffer与StringBuilder之间区别
    Java String之String和CharSequence、StringBuilder和StringBuffer的区别(1)
    Rational Rose2007(v7.0)下载地址、安装及激活详解教程
    FileSystemXmlApplicationContext、ClassPathXmlApplicationContext和XmlWebApplicationContext简介
    洛克菲勒
    NOIP提高组DAY1T2——信息传递(最小环)
    洛谷P2016——战略游戏(树形)
    数字转换(树上直径)
    洛谷P2014——选课(树形dp)
    没有上司的舞会(简单树形dp)
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/13307342.html
Copyright © 2020-2023  润新知