elasticsearch_exporter监控elasticsearch

1、官网下载elasticsearch_exporter的安装包,地址如下:
```bash
https://github.com/prometheus-community/elasticsearch_exporter
```
2、配置成服务
```bash
vim /etc/systemd/system/elasticsearch_exporter.service ###写入如下内容
[Unit]
Description=elasticsearch_exporter
After=syslog.target network.target
[Service]
Type=simple
RemainAfterExit=no
WorkingDirectory=/usr/local/elasticsearch_exporter/
User=root
Group=root
ExecStart=/usr/local/elasticsearch_exporter/elasticsearch_exporter --es.timeout=5s --web.listen-address ":9555" --es.uri http://user:password@172.21.210.49:9200
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target

#启动
#配置开机自启,并启动:
systemctl daemon-reload
systemctl enable elasticsearch_exporter
systemctl start elasticsearch_exporter
systemctl status elasticsearch_exporter -l

#查看数据采集
curl http://172.21.210.48:9555/metrics
```
3、prometheus配置
```bash
调整配置文件,与elasticsearch_exporter连接:
vim /usr/local/prometheus/prometheus.yml
- job_name: 'elasticsearch_cluster'
static_configs:
- targets:
- 172.21.210.48:9555
#重载promeitheus
curl -X POST http://127.0.0.1:9090/-/reload
```

4、grafna进行页面展示
导入模板2322 Grafana Dashboard:https://grafana.com/grafana/dashboards/2322

 

posted @   苍茫宇宙  阅读(606)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2020-10-12 mysql使用docker安装
2020-10-12 mysql密码规则配置-配置为简单密码123456
点击右上角即可分享
微信分享提示