This bash script create a redis cluster with 9 docker container.
My host ip address is 192.168.111.111
So you should change the ip address with ip address of your host.
accessing cluster;
redis-cli -c -h 192.168.111.111
( then 6379 port changed automaticaly 7001-7009 )
you should see like this for list all keys in cluster.
redis-cli --cluster call 192.168.111.111:6379 keys "*"
>>> Calling keys *
192.168.111.111:6379: b
192.168.111.111:7003: a
192.168.111.111:7004: a
192.168.111.111:7002:
192.168.111.111:7007:
192.168.111.111:7005: b
192.168.111.111:7008:
192.168.111.111:7009: a
192.168.111.111:7006: b