카이도스의 Tech Blog
Redis Exporter 본문
728x90
반응형
- Redis Exporter 설치
# Redis 서버 접속
# go 다운로드
wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
sudo tar -xvf go1.20.2.linux-amd64.tar.gz
sudo mv go /usr/local
# 환경변수
cat <<EOT>> ~/.bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
EOT
source ~/.bashrc
go version
# Git 소스 다운로드
git clone https://github.com/oliver006/redis_exporter.git
cd redis_exporter
go build .
# Redis_exporter 버전 확인
./redis_exporter --version
# Redis_exporter 복제
sudo cp redis_exporter /usr/bin/
# 데몬 설정
sudo vi /etc/systemd/system/redis_exporter.service
[Unit]
Description=Redis Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=ubuntu
Group=ubuntu
Type=simple
ExecStart=/usr/bin/redis_exporter \
-web.listen-address "0.0.0.0:9121" \
-redis.addr "redis://IP:6379" \
-redis.password "PASSWD" \
[Install]
WantedBy=multi-user.target
# Redis_exporter 데몬 재기동
sudo systemctl daemon-reload
sudo systemctl enable redis_exporter
sudo systemctl start redis_exporter
sudo systemctl status redis_exporter.service
# 확
curl localhost:9121/metrics
# Prometheus 설정
sudo vi /etc/prometheus/prometheus.yml
- job_name: redis_exporter
metrics_path: "/metrics"
static_configs:
- targets: ['IP:9121']
# Prometheus 재기동
sudo systemctl restart prometheus.service
sudo systemctl status prometheus.service
728x90
반응형
'모니터링' 카테고리의 다른 글
nGrinder 설치 (0) | 2024.02.28 |
---|---|
mongodb_exporter 설치 (0) | 2024.02.04 |
Grafana, Loki, Promtail 모니터링+로그 셋팅+zabbix 연동 (0) | 2023.04.26 |
Datadog Agent 설치 (0) | 2023.04.04 |
DATADOG-AWS 연동 (0) | 2023.03.29 |
Comments