安装elasticsearch_exporter
下载软件包
[root@VM-39-7-centos opt]# wget https://github.com/justwatchcom/elasticsearch_exporter/releases/download/v1.1.0/elasticsearch_exporter-1.1.0.linux-amd64.tar.gz
安装启动
tar -zxvf elasticsearch_exporter-1.1.0.linux-amd64.tar.gz -C /usr/local/
cd /usr/local/
mv elasticsearch_exporter-1.1.0.linux-amd64 elasticsearch_exporter
cd elasticsearch_exporter/
nohup ./elasticsearch_exporter --web.listen-address=":9114" --es.uri http://127.0.0.1:9200 &
netstat -nltp
curl http://127.0.0.1:9114/metrics
修改prometheus配置文件
[root@codeversionforgitserver prometheus]# more prometheus.yml
......
- job_name: 'elasticsearch'
scrape_interval: 60s
scrape_timeout: 30s
metrics_path: "/metrics"
static_configs:
- targets: ['10.144.1.121:9114']
重启prometheus应用
验证prometheus关联是否成功
Grafana配置监控面板
导入2322的id面板