$ docker pull yyyyttttwwww/redis
docker network create –subnet=172.19.0.0/24 net2
$ docker -it -d --name r1 -p 5001:6379 -net=net2 --ip 172.19.0.2 redis bash
$ cd /usr/redis/src
$ ./redis-server ../redis.conf
$ cp /usr/redis/src/redis=trib.rb /usr/redis/cluster/
$ cd /usr/redis/cluster
$ apt-get install ruby
$ apt-get intall rubygems
$ gem install redis
#在r1节点上执行下面的指令
$ cd /usr/redis/src
$ mkdir -p ../cluster
$ cp redis-trib.rb ../cluster/
$ cd ../cluster
#创建Cluster集群
$ ./redis-trib.rb create --replicas 1 172.19.0.2:6379 172.19.0.3:6379 172.19.0.4:6379 172.19.0.5:6379 172.19.0.6:6379 172.19.0.7:6379
redis 中通过cluster nodes 查看集群状态