解压
tar -zxvf redis_exporter-v0.33.0.linux-amd64.tar.gz -C /usr/local/bin/
启动方式
方式一
默认端口 9121
./redis_exporter -redis.password=123456 &
方式二(系统服务systemctl) 强烈建议此种方式
编写开机启动脚本(/usr/lib/systemd/system/redis-exporter.service)
[Unit]Description=redis监控日志After=network.target[Service]ExecStart=/usr/local/bin/redis_exporter -redis.password=123456[Install]WantedBy=multi-user.target
启动
启动测试
systemctl start redis-exporter
开机启动
systemctl enable redis-exporter
redis_exporter-v0.33.0.linux-amd64.tar.gz
开机服务项
关于redis-exporter的开机启动配置
- 下载安装包到/opt下
- 需要用root账号登录进入到/usr/lib/systemd/system目录下
创建redis_exporter.service启动文件
[Unit]Description=redis监控日志After=network.target[Service]ExecStart=/opt/redis_exporter-v1.6.1.linux-amd64/redis_exporter -redis.password=zvIZ31Yn3G[Install]WantedBy=multi-user.target
配置完成以后用root账号设置成开机启动 systemctl enable redis_exporter.service
# 重新加载服务文件(当修改 service 文件的时候需要操作)$ systemctl daemon-reload# 设置开机启动$ systemctl enable redis_exporter.service# 启动$ systemctl start redis_exporter.service# 查看状态$ systemctl status redis_exporter.service# 热重启$ systemctl reload redis_exporter.service
报警规则 所有时间取值1s
redis 异常
- 当前连接数大于200
