Prometheus + Grafana - Redis ๊ตฌ์ถ
2023. 7. 31. 10:31ใ๊ฐ๋ฐ/Monitoring
728x90
๋ฐ์ํ
๐ก ์ค๋น๋ฌผ : ubuntu, redis, Prometheus, Grafana
๋ชจ๋ํฐ๋ง ๋์ ์ค์
Redis ์ค์น
Redis exporter ์ค์น
wget <https://github.com/oliver006/redis_exporter/releases/download/v1.24.0/redis_exporter-v1.24.0.linux-amd64.tar.gz>
# ์์ถ ํด์ ๋ฐ ํ์ผ ๋ณต์ฌ
tar -zxvf redis_exporter-v1.24.0.linux-amd64.tar.gz
cd redis_exporter-v1.24.0.linux-amd64
cp redis_exporter /usr/bin/ # root ๊ณ์
Systemd ๋ฑ๋ก ๋ฐ ์คํ
vim /etc/systemd/system/redis_exporter.service
# redis_exporter.service
[Unit]
Description=Redis Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=root
Group=root
Type=simple
ExecStart=/usr/bin/redis_exporter \\
-web.listen-address ":9121" \\
-redis.addr "redis://IP ์ฃผ์:6379" \\
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable redis_exporter
systemctl start redis_exporter # ์คํ
curl -XGET <http://localhost:9121/metrics> # ์ ์ ํ์ธ
Prometheus.yml ์ถ๊ฐ ์์
- job_name: "redis"
static_configs:
- targets: "119.207.74.103:9121"
Prometheus.yml ์ฒดํฌ
./promtool check config prometheus.yml
systemctl restart prometheus # ์ฌ๊ธฐ๋
ํ์ธ
Prometheus ์ ์ ์ฐ๊ฒฐ ํ์ธ
๋์๋ณด๋ ๊ตฌ์ฑ
์ด๋ฏธ ๋ง๋ค์ด์ ธ ์๋ Redis ๋์๋ณด๋๋ฅผ ๋ฑ๋ก
URL : https://grafana.com/grafana/dashboards/11835
URL ์ Import via grafana.com ์ ๋ฃ๋๋ค.
๋ง์ง๋ง Prometheus์ ์ค์ ์ ๋ฑ๋ก ํ๋ค Import ๋ฒํผ ํด๋ฆญ
728x90
๋ฐ์ํ
'๊ฐ๋ฐ > Monitoring' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Prometheus + Grafana - RabbitMQ ๊ตฌ์ถ (0) | 2023.07.31 |
---|---|
Prometheus + Grafana - ์ฐ๊ฒฐ (0) | 2023.07.31 |
Prometheus, Grafana - ์ด๋ก (0) | 2023.07.31 |