prometheus监控es集群 — elasticsearch_exporter

1.下载elasticsearch_exporter的二进制包并解压、运行

下载二进制包并解压、运行:
$ wget https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.3.0/elasticsearch_exporter-1.3.0.linux-amd64.tar.gz
$ tar -xvf elasticsearch_exporter-1.3.0.linux-amd64.tar.gz
$ mv elasticsearch_exporter-1.3.0.linux-amd64/ elasticsearch_exporter
$ cd elasticsearch_exporter/

运行elasticsearch_exporter:
$ nohup ./elasticsearch_exporter --es.all --es.indices --es.cluster_settings --es.indices_settings --es.shards --es.snapshots --es.timeout=10s --web.listen-address=":9114" --web.telemetry-path="/metrics" --es.uri http://10.20.30.40:9200 &xelasticsearch_exporter

查看输出日志:
$ tailf nohup.out  

看指标信息:
$ curl "http://10.20.30.40:9114/metrics"   

2.在Prometheus配置文件中加入新的job_name,写elasticsearch_exporter暴露指标的ip端口:

添加job_name部分:
$ cat prometheus.yml                      
  - job_name: "elasticsearch_exporter"
    static_configs:
            - targets: ["10.20.30.40:9114"]

重启prometheus:
$ systemctl restart prometheus.service 

3.在 Prometheus Web 查看监控抓取目标,抓取成功:

4.grafana确认已添加prometheus数据源

5. 在grafana Web 上导入仪表盘id为2322,选择prometheus数据源,在该仪表盘里可看到监控elasticsearch集群指标的完整信息。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值