下面内容大部分借鉴自:
http://louz.github.io/2016/08/11/docker-redis-cluster/
docker pull redis:3.0.7
#映射6379端口,以便外部应用访问
docker run -d --name mynode1 -p 10.168.12.75:17001:6379 zbw911/redis-cluster
docker run -d --name mynode2 -p 10.168.12.75:17002:6379 zbw911/redis-cluster
docker run -d --name mynode3 -p 10.168.12.75:17003:6379 zbw911/redis-cluster
docker run -d --name mynode4 -p 10.168.12.75:17004:6379 zbw911/redis-cluster
docker run -d --name mynode5 -p 10.168.12.75:17005:6379 zbw911/redis-cluster
docker run -d --name mynode6 -p 10.168.12.75:17006:6379 zbw911/redis-cluster
docker run -d --name mynode1 -p 6379:6379 zbw911/redis-cluster
docker run -d --name mynode2 zbw911/redis-cluster
docker run -d --name mynode3 zbw911/redis-cluster
docker run -d --name mynode4 zbw911/redis-cluster
docker run -d --name mynode5 zbw911/redis-cluster
docker run -d --name mynode6 zbw911/redis-cluster
docker inspect --format='{{.NetworkSettings.IPAddress}}' mynode1
docker inspect --format='{{.NetworkSettings.IPAddress}}' mynode2
docker inspect --format='{{.NetworkSettings.IPAddress}}' mynode3
docker inspect --format='{{.NetworkSettings.IPAddress}}' mynode4
docker inspect --format='{{.NetworkSettings.IPAddress}}' mynode5
docker inspect --format='{{.NetworkSettings.IPAddress}}' mynode6
docker run -it zbw911/ruby22-redis307 /bin/bash
/usr/local/redis/src/redis-trib.rb create --replicas 1
172.17.0.2:6379 172.17.0.3:6379 172.17.0.4:6379
172.17.0.5:6379 172.17.0.6:6379 172.17.0.7:6379
docker run -it --link mynode1:mynode1 --rm redis:3.0.7 redis-cli -h mynode1 -p 6379 -c