ElasticSearch 接入 Prometheus
系列文章目录
- Prometheus 的安装部署
- Grafana的安装部署
- Linux服务器接入Prometheus监控-Node Exporter 安装指南
- Prometheus 接入SpringBoot微服务监控
- Mysql 接入 Prometheus
- RocketMQ 接入Prometheus 监控
- ElasticSearch 接入 Prometheus
- Nacos 接入 Prometheus 监控
- Redis 接入 Prometheus 监控系统
- Prometheus + Grafana 监控系统-告警规则配置
- Prometheus + Grafana 监控系统-PrometheusAlert安装与配置指南
-
下载安装 elasticsearch_exporter
- 下载地址: https://github.com/prometheus-community/elasticsearch_exporter
cd /home/work/software/ wget https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.7.0/elasticsearch_exporter-1.7.0.linux-amd64.tar.gz tar -xzvf elasticsearch_exporter-*.linux-amd64.tar.gz # 改名-可选 #mv elasticsearch_exporter-1.7.0.linux-amd64 elasticsearch_exporter
- 注册成一个service
useradd esadmin vim /etc/systemd/system/elasticsearch_exporter.service # 内容如下: [Unit] Description=Redis Exporter After=network.target [Service] User=esadmin ExecStart=/home/work/software/elasticsearch_exporter/elasticsearch_exporter \ --collector.clustersettings \ --collector.snapshots \ --es.all \ --es.indices \ --es.node="_local" \ --es.indices_settings \ --es.shards \ --es.timeout=15s \ --es.ssl-skip-verify \ --es.clusterinfo.interval=5m \ --es.uri http://elastic:[email protected]:9200 \ --web.listen-address=:9114 ExecReload=/bin/kill -HUP Restart=on-failure [Install] WantedBy=multi-user.target
- 管理 elasticsearch_exporter 服务
sudo systemctl daemon-reload sudo systemctl enable elasticsearch_exporter sudo systemctl start elasticsearch_exporter # 查看效果 curl http://localhost:9114/metrics
-
集成到Prometheus
- prometheus.yml 增加如下配置即可
scrape_configs - job_name: "elasticsearch_exporter" static_configs: - targets: ["stg-es:9114"]
-
Grafana 添加 对应 仪表盘
- 官方版本: https://grafana.com/grafana/dashboards/14191-elasticsearch-overview/