./redis.sh
test the redis cluster
docker run -it --rm --net mynet redis:3.2.6 redis-cli -c -h redis -p 6379
10.0.0.7:6379> set mykey1 1
OK
10.0.0.7:6379> set mykey2 2
-> Redirected to slot [14119] located at 10.0.0.6:6379
OK
10.0.0.6:6379> set mykey3 3
-> Redirected to slot [9990] located at 10.0.0.4:6379
OK
10.0.0.4:6379> get mykey1
-> Redirected to slot [1860] located at 10.0.0.7:6379
"1"
10.0.0.7:6379> get mykey2
-> Redirected to slot [14119] located at 10.0.0.6:6379
"2"
10.0.0.6:6379> get mykey3
-> Redirected to slot [9990] located at 10.0.0.4:6379
"3"
10.0.0.4:6379>
2019-10-16 04:06:47 (348 MB/s) - 'redis-trib.rb' saved [3600/3600]
WARNING: redis-trib.rb is not longer available!
You should use redis-cli instead.
All commands and features belonging to redis-trib.rb have been moved
to redis-cli.
In order to use them you should call redis-cli with the --cluster
option followed by the subcommand name, arguments and options.
Use the following syntax:
redis-cli --cluster SUBCOMMAND [ARGUMENTS] [OPTIONS]
Example:
redis-cli --cluster create 10.0.26.20:6379 10.0.26.21:6379 10.0.26.24:6379 10.0.26.23:6379 10.0.26.19:6379 10.0.26.22:6379 --cluster-replicas 1
To get help about all subcommands, type:
redis-cli --cluster help