安装redis_exporter
下载软件包
[root@gtcq-gt-resource2-db-03 ~]# cd /opt/ ;scp root@10.152.17.11:/opt/redis_exporter-v1.6.1.linux-amd64.tar.gz /opt
安装启动
[root@gtcq-gt-resource2-db-03 opt]# tar -zxvf redis_exporter-v1.6.1.linux-amd64.tar.gz -C /usr/local/
[root@gtcq-gt-resource2-db-03 opt]# cd /usr/local/
[root@gtcq-gt-resource2-db-03 local]# mv redis_exporter-v1.6.1.linux-amd64 redis_exporter-gt_work
[root@gtcq-gt-resource2-db-03 local]# cd redis_exporter-gt_work/
[root@gtcq-gt-resource2-db-03 redis_exporter-gt_work]# nohup ./redis_exporter -redis.addr 10.152.17.52:8807 -redis.password xbcky13k -web.listen-address 10.152.17.52:9121 > /dev/null 2>&1 &
修改Prometheus配置文件
- job_name: 'GT_WORK_REDIS_CULSTER'
static_configs:
- targets:
- redis://10.152.17.50:8807
- redis://10.152.17.50:8808
- redis://10.152.17.51:8807
- redis://10.152.17.51:8808
- redis://10.152.17.52:8807
- redis://10.152.17.52:8808
metrics_path: /scrape
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 10.152.17.52:9121
- job_name: 'gtcq-gt-work-redis_exporter'
static_configs:
- targets:
- 10.152.17.52:9121
展示