Prometheus +Grafana监控Elasticsearch集群
1、监控说明
监控原理跟我上一遍记录prometheus监控redis类似,通过elasticsearch_exporter,对Elasticsearch集群进行监控
2、下载安装elasticsearch_exporter
https://github.com/justwatchcom/elasticsearch_exporter
3、解压配置启动
cd /usr/local/elasticsearch_exporter
nohup ./elasticsearch_exporter --es.uri https://localhost:9200 &
注:如果多个集群,可以加上参数--web.listen-address=":9115"
4、配置Prometheus
vim prometheus.yml
#采集ES集群监控数据
- job_name: ES_cluster_9200
static_configs:
- targets: ['10.31.65.129:9114','10.31.65.130:9114','10.31.65.131:9114']
labels:
instance: elasticsearch_cluster_9200
重启Prometheus
systemctl restart prometheus
5、下载Grafana模板并导入
Grafana Dashboard:https://grafana.com/grafana/dashboards/2322
导入json
稍微等一会,就会有数据
评论