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指标。
  • 相关阅读:
    004: 基本数据类型-List
    003: 基本类型-字符串类型
    002: 基本类型-数值型(int, float)
    001: Hello World
    Python中的单例模式的几种实现方式的及优化
    django之admin组件
    权限管理---设计分析以及具体细节
    基于Form组件实现的增删改和基于ModelForm实现的增删改
    Python常见问题系列
    django的render的说明
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/13307342.html
Copyright © 2011-2022 走看看