yum install -y redis
rpm -qa |grep redis
lsof -i :6379
rpm -ql redis
systemctl start redis
wget https://github.com/oliver006/redis_exporter/releases/download/v1.4.0/redis_exporter-v1.4.0.linux-amd64.tar.gz
tar zxvf redis_exporter-v1.4.0.linux-amd64.tar.gz
mv redis_exporter-v1.4.0.linux-amd64 /usr/local/exporter/redis_exporter
cd /usr/local/exporter/redis_exporter
## 有密码
nohup ./redis_exporter -redis.addr 127.0.0.1:6379 -redis.password QpMD61xo
## 无密码
nohup ./redis_exporter -redis.addr 192.168.1.120:6379 &
[root@Prometheus redis_exporter]# tail -f nohup.out
time="2020-02-22T12:26:24+08:00" level=info msg="Redis Metrics Exporter v1.4.0 build date: 2020-02-22-02:07:24 sha1: dde61ca2367f5fdb1f4a0c49022fcb0135715d22 Go: go1.13.8 GOOS: linux GOARCH: amd64"
time="2020-02-22T12:26:24+08:00" level=info msg="Providing metrics at :9121/metrics"
- job_name: 'redis'
scrape_interval: 10s
static_configs:
- targets: ["114.67.116.119:9121"]
kill -hup `ps -ef |grep prometheus|grep -v grep|awk '{print $2}'`
或者
kill -9 PID
/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml