docker pull redis:5.0.2 #cd 到 /root/workspace/ mkdir -p /docker/redis-node01/data mkdir -p /docker/redis-node02/data mkdir -p /docker/redis-node03/data # 部署Redis集群,该集群有3个节点 docker create --name redis-node01 --privileged=true -v /root/workspace/docker/redis-node01/data:/data -p 6379:6379 redis:5.0.2 --cluster-enabled yes --cluster-config-file nodes-node-01.conf --port 6379
docker create --name redis-node02 --privileged=true -v /root/workspace/docker/redis-node02/data:/data -p 6380:6380 redis:5.0.2 --cluster-enabled yes --cluster-config-file nodes-node-02.conf --port 6380
docker create --name redis-node03 --privileged=true -v /root/workspace/docker/redis-node03/data:/data -p 6381:6381 redis:5.0.2 --cluster-enabled yes --cluster-config-file nodes-node-03.conf --port 6381
#启动容器 docker start redis-node01 redis-node02 redis-node03
|