zoukankan      html  css  js  c++  java
  • 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指标。
  • 相关阅读:
    cmd 进入mysql 小技巧
    【scikit-learn】交叉验证及其用于參数选择、模型选择、特征选择的样例
    向txt文件中写入换行
    CTabCtrl的使用
    unicode下数据之间的转换
    下载数据库包
    python3.5.1语法
    配置Python+selenium+firefox自动化测试
    使用Tesseract OCR识别验证码
    white的配置使用
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/13307342.html
Copyright © 2011-2022 走看看