前言
redis_exporter服务用于收集redis服务的相关信息(eg: 内存、运行天数、连接客户端等)
部署
]# mkdir -p /data/redis
]# cd /data/redis
]# cat > /data/redis/docker-compose.yml <<-EOF
version: '3.7'
services:
redis:
image: redis
container_name: redis
hostname: redis
ports:
- 6379:6379
volumes:
- /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
restart: always
redis_exporter:
image: oliver006/redis_exporter:latest
container_name: redis_exporter
hostname: redis_exporter
ports:
- 9121:9121
volumes:
- /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
restart: always
EOF
]# docker-compose up -d