Redis集群搭建
基于 CentOS 7 + Docker 19.03.13
docker create --name redis-node01 --restart=always --net host -v redis-node01:/data redis --cluster-enabled yes --cluster-config-file nodes-node-01.conf --port 6379
docker create --name redis-node02 --restart=always --net host -v redis-node02:/data redis --cluster-enabled yes --cluster-config-file nodes-node-02.conf --port 6380
docker create --name redis-node03 --restart=always --net host -v redis-node03:/data redis --cluster-enabled yes --cluster-config-file nodes-node-03.conf --port 6381
docker start redis-node01 redis-node02 redis-node03
docker exec -it redis-node01 /bin/bash
redis-cli --cluster create 192.168.241.100:6379 192.168.241.100:6380 192.168.241.100:6381 --cluster-replicas 0
redis-cli -c
docker stop redis-node01 redis-node02 redis-node03
docker rm redis-node01 redis-node02 redis-node03
docker volume prune