Merge remote-tracking branch 'artix/trib2cli' into unstable

This commit is contained in:
antirez 2018-05-17 16:52:31 +02:00
commit 3c43e984db
6 changed files with 3703 additions and 18 deletions

View File

@ -146,7 +146,7 @@ REDIS_SERVER_NAME=redis-server
REDIS_SENTINEL_NAME=redis-sentinel REDIS_SENTINEL_NAME=redis-sentinel
REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o
REDIS_CLI_NAME=redis-cli REDIS_CLI_NAME=redis-cli
REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o REDIS_CLI_OBJ=anet.o adlist.o dict.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o siphash.o crc16.o
REDIS_BENCHMARK_NAME=redis-benchmark REDIS_BENCHMARK_NAME=redis-benchmark
REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adlist.o zmalloc.o redis-benchmark.o REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adlist.o zmalloc.o redis-benchmark.o
REDIS_CHECK_RDB_NAME=redis-check-rdb REDIS_CHECK_RDB_NAME=redis-check-rdb

File diff suppressed because it is too large Load Diff

View File

@ -73,12 +73,12 @@ test "Cluster consistency during live resharding" {
flush stdout flush stdout
set target [dict get [get_myself [randomInt 5]] id] set target [dict get [get_myself [randomInt 5]] id]
set tribpid [lindex [exec \ set tribpid [lindex [exec \
../../../src/redis-trib.rb reshard \ ../../../src/redis-cli --cluster reshard \
--from all \
--to $target \
--slots 100 \
--yes \
127.0.0.1:[get_instance_attrib redis 0 port] \ 127.0.0.1:[get_instance_attrib redis 0 port] \
--cluster-from all \
--cluster-to $target \
--cluster-slots 100 \
--cluster-yes \
| [info nameofexecutable] \ | [info nameofexecutable] \
../tests/helpers/onlydots.tcl \ ../tests/helpers/onlydots.tcl \
&] 0] &] 0]

View File

@ -31,9 +31,9 @@ test "Each master should have at least two replicas attached" {
set master0_id [dict get [get_myself 0] id] set master0_id [dict get [get_myself 0] id]
test "Resharding all the master #0 slots away from it" { test "Resharding all the master #0 slots away from it" {
set output [exec \ set output [exec \
../../../src/redis-trib.rb rebalance \ ../../../src/redis-cli --cluster rebalance \
--weight ${master0_id}=0 \ 127.0.0.1:[get_instance_attrib redis 0 port] \
127.0.0.1:[get_instance_attrib redis 0 port] >@ stdout] --cluster-weight ${master0_id}=0 >@ stdout ]
} }
test "Master #0 should lose its replicas" { test "Master #0 should lose its replicas" {
@ -49,10 +49,10 @@ test "Resharding back some slot to master #0" {
# new resharding. # new resharding.
after 10000 after 10000
set output [exec \ set output [exec \
../../../src/redis-trib.rb rebalance \ ../../../src/redis-cli --cluster rebalance \
--weight ${master0_id}=.01 \ 127.0.0.1:[get_instance_attrib redis 0 port] \
--use-empty-masters \ --cluster-weight ${master0_id}=.01 \
127.0.0.1:[get_instance_attrib redis 0 port] >@ stdout] --cluster-use-empty-masters >@ stdout]
} }
test "Master #0 should re-acquire one or more replicas" { test "Master #0 should re-acquire one or more replicas" {

View File

@ -15,7 +15,7 @@ To create a cluster, follow these steps:
1. Edit create-cluster and change the start / end port, depending on the 1. Edit create-cluster and change the start / end port, depending on the
number of instances you want to create. number of instances you want to create.
2. Use "./create-cluster start" in order to run the instances. 2. Use "./create-cluster start" in order to run the instances.
3. Use "./create-cluster create" in order to execute redis-trib create, so that 3. Use "./create-cluster create" in order to execute redis-cli --cluster create, so that
an actual Redis cluster will be created. an actual Redis cluster will be created.
4. Now you are ready to play with the cluster. AOF files and logs for each instances are created in the current directory. 4. Now you are ready to play with the cluster. AOF files and logs for each instances are created in the current directory.

View File

@ -34,7 +34,7 @@ then
PORT=$((PORT+1)) PORT=$((PORT+1))
HOSTS="$HOSTS 127.0.0.1:$PORT" HOSTS="$HOSTS 127.0.0.1:$PORT"
done done
../../src/redis-trib.rb create --replicas $REPLICAS $HOSTS ../../src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS
exit 0 exit 0
fi fi
@ -94,7 +94,7 @@ fi
echo "Usage: $0 [start|create|stop|watch|tail|clean]" echo "Usage: $0 [start|create|stop|watch|tail|clean]"
echo "start -- Launch Redis Cluster instances." echo "start -- Launch Redis Cluster instances."
echo "create -- Create a cluster using redis-trib create." echo "create -- Create a cluster using redis-cli --cluster create."
echo "stop -- Stop Redis Cluster instances." echo "stop -- Stop Redis Cluster instances."
echo "watch -- Show CLUSTER NODES output (first 30 lines) of first node." echo "watch -- Show CLUSTER NODES output (first 30 lines) of first node."
echo "tail <id> -- Run tail -f of instance at base port + ID." echo "tail <id> -- Run tail -f of instance at base port + ID."