Redis集群部署
March 3, 2025
[!note] 以下是为 Redis 7.2.4(最新版本-我替换成了latest)编写的完整 docker-compose.yml 文件,包含 6 个节点 (3 主 + 3 从) 的完整配置: 安装 # version: '3.8' services: redis-7000: image: redis:latest container_name: redis-7000 command: redis-server /usr/local/etc/redis/redis.conf volumes: - ./config/redis-7000.conf:/usr/local/etc/redis/redis.conf - ./data/7000:/data networks: - redis-cluster-net ports: - "7000:7000" - "17000:17000" redis-7001: image: redis:latest container_name: redis-7001 command: redis-server /usr/local/etc/redis/redis.conf volumes: - ./config/redis-7001.conf:/usr/local/etc/redis/redis.conf - ./data/7001:/data networks: - redis-cluster-net ports: - "7001:7001" - "17001:17001" redis-7002: image: redis:latest container_name: redis-7002 command: redis-server /usr/local/etc/redis/redis.conf volumes: - . ...