栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

prometheus监控传统环境监控(七)ElasticSearch监控

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

prometheus监控传统环境监控(七)ElasticSearch监控

组件名称:elasticsearch-exporter

github地址:GitHub - prometheus-community/elasticsearch_exporter: Elasticsearch stats exporter for Prometheus

监控目标:192.168.0.100、192.168.0.101、192.168.0.102集群

组件部署位置:192.168.0.39

docker-cpmpose启动

cat /data/docker-compose_dir/elastic/docker-compose.yml

version: '3'
services:
  sticsearch_exporter-192.168.0.100:
    image: quay.io/prometheuscommunity/elasticsearch-exporter:latest
    command:
     - '--es.uri=http://192.168.0.100:9200'
    restart: always
    ports:
    - "0.0.0.0:9600:9114"

  sticsearch_exporter-192.168.0.101:
    image: quay.io/prometheuscommunity/elasticsearch-exporter:latest
    command:
     - '--es.uri=http://192.168.0.101:9200'
    restart: always
    ports:
    - "0.0.0.0:9601:9114"

  sticsearch_exporter-192.168.0.102:
    image: quay.io/prometheuscommunity/elasticsearch-exporter:latest
    command:
     - '--es.uri=http://192.168.0.102:9200'
    restart: always
    ports:
    - "0.0.0.0:9602:9114"

启动

docker-compose up -d

 

prometheus集成组件

# elasticsearch_exporter
  - job_name: elastic-192.168.0.100
    scrape_interval: 15s
    static_configs:
    - targets: ['192.168.0.39:9600']

  - job_name: elastic-192.168.0.101
    scrape_interval: 15s
    static_configs:
    - targets: ['192.168.0.39:9601']

  - job_name: elastic-192.168.0.102
    scrape_interval: 15s
    static_configs:
    - targets: ['192.168.0.39:9602']

告警配置

# cat elastic-rules.yaml

 groups:
    - name: ElasticSearch-监控告警
      rules:
      - alert: 集群节点数减少告警
        expr: elasticsearch_cluster_health_number_of_nodes < 4
        for: 5m
        labels:
          severity: warning
          status: 非常严重
        annotations:
          summary: "ES集群节点数减少:{{$.Labels.job}}"
          description: "ES集群节点数减少:{{$.Labels.job}},(当前:{{$value}})"
     
      - alert: jvm内存使用率告警
        expr: elasticsearch_jvm_memory_used_bytes{area="heap"} / elasticsearch_jvm_memory_max_bytes{area="heap"} > 0.9
        for: 5m
        labels:
          severity: warning
          status: 非常严重
        annotations:
          summary: "jvm内存使用率过高:{{$.Labels.job}}"
          description: "jvm内存使用率过高:{{$.Labels.job}} => 0.9,(当前:{{$value}})"

重启prometheus

docker restart prometheus

grafana图形:

2322

具体需要微调一下

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/940856.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号