zoukankan      html  css  js  c++  java
  • Prometheus监控elasticsearch集群(以elasticsearch-6.4.2版本为例)

    部署elasticsearch集群,配置文件可“浓缩”为以下:

    cluster.name: es_cluster
    node.name: node1
    
    path.data: /app/data/elasticsearch
    path.logs: /app/logs/elasticsearch
    
    network.host: 192.168.x.x
    http.port: 9200
    transport.tcp.port: 9201
    discovery.zen.ping.unicast.hosts: ["node1", "node2","node3"]
    discovery.zen.minimum_master_nodes: 2
    gateway.recover_after_nodes: 3
    gateway.expected_nodes: 3
    gateway.recover_after_time: 5m
    http.cors.enabled: true
    http.cors.allow-origin: "*"
    thread_pool.bulk.queue_size: 500
    xpack.security.enabled: false
    

    下载插件进行并进行安装

    插件下载地址: https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases

    安装: 如果有elk单独用户,切换到该用户下, wget下载,进入到es安装目录,执行 ./elasticsearch-plugin install file://$(pwd)/../../elasticsearch-prometheus-exporter-6.4.2.0.zip 即可完成安装

    配置Prometheus, 添加如下配置,并重新启动Prometheus

    - job_name: 'elasticsearch'
        scrape_interval: 30s
        metrics_path: "/_prometheus/metrics"
        static_configs:
        - targets:
          - 192.168.x.x:9200
          - 192.168.x.x:9200
          - 192.168.x.x:9200
    

    配置Grafana, 导入模板,编号建议为 266 (https://grafana.com/dashboards/266) 选择数据源为 Prometheus , 添加即可,会出现如下的监控图

  • 相关阅读:
    二进制数组ArrayBuffer
    iperf3测量一个网络最大带宽
    Proxy与Reflect
    Symbol
    Iterator
    Set与Map
    Generator
    Android 共享参数 SharedPreferences
    DDMS files not found: xxxhprof-conv.exe
    Android 状态栏通知 Notification
  • 原文地址:https://www.cnblogs.com/DevOpsTechLab/p/10676362.html
Copyright © 2011-2022 走看看