前言
本文主要介绍如何使用Grafana和Prometheus以及elasticsearch_exporter对Elasticsearch性能进行监控。
1.安装elasticsearch_exporter
1.1.下载
下载地址:https://github.com/justwatchcom/elasticsearch_exporter/releases
1.2.上传解压
上传elasticsearch_exporter-1.1.0.linux-amd64.tar.gz安装包并解压到/usr/local目录
tar -xvf elasticsearch_exporter-1.1.0.linux-amd64.tar.gz cd elasticsearch_exporter-1.1.0.linux-amd64/
1.3.启动
- 进入根目录下,输入以下命令:
nohup ./elasticsearch_exporter --es.uri http://10.0.101.100:9200 &
注:--es.uri 指定的是es的服务地址。
- 输入以下命令查看日志是否启动成功:
tail -1000f nohup.out
- 启动成功后,可以访问 http://10.xx.xxx.100:9114/metrics/ ,看抓取的指标信息:
2.Prometheus配置
2.1.配置
修改prometheus组件的prometheus.yml加入elasticsearch节点:
2.2.启动验证
保存以后重启Prometheus,查看targets:
注:State=UP,说明成功
3.Grafana配置
3.1.下载仪表盘
下载地址:https://grafana.com/grafana/dashboards/2322