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_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_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_OBJ=ae.o anet.o redis-benchmark.o adlist.o zmalloc.o redis-benchmark.o
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
set target [dict get [get_myself [randomInt 5]] id]
set tribpid [lindex [exec \
../../../src/redis-trib.rb reshard \
--from all \
--to $target \
--slots 100 \
--yes \
../../../src/redis-cli --cluster reshard \
127.0.0.1:[get_instance_attrib redis 0 port] \
--cluster-from all \
--cluster-to $target \
--cluster-slots 100 \
--cluster-yes \
| [info nameofexecutable] \
../tests/helpers/onlydots.tcl \
&] 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]
test "Resharding all the master #0 slots away from it" {
set output [exec \
../../../src/redis-trib.rb rebalance \
--weight ${master0_id}=0 \
127.0.0.1:[get_instance_attrib redis 0 port] >@ stdout]
../../../src/redis-cli --cluster rebalance \
127.0.0.1:[get_instance_attrib redis 0 port] \
--cluster-weight ${master0_id}=0 >@ stdout ]
}
test "Master #0 should lose its replicas" {
@ -49,10 +49,10 @@ test "Resharding back some slot to master #0" {
# new resharding.
after 10000
set output [exec \
../../../src/redis-trib.rb rebalance \
--weight ${master0_id}=.01 \
--use-empty-masters \
127.0.0.1:[get_instance_attrib redis 0 port] >@ stdout]
../../../src/redis-cli --cluster rebalance \
127.0.0.1:[get_instance_attrib redis 0 port] \
--cluster-weight ${master0_id}=.01 \
--cluster-use-empty-masters >@ stdout]
}
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
number of instances you want to create.
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.
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))
HOSTS="$HOSTS 127.0.0.1:$PORT"
done
../../src/redis-trib.rb create --replicas $REPLICAS $HOSTS
../../src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS
exit 0
fi
@ -94,7 +94,7 @@ fi
echo "Usage: $0 [start|create|stop|watch|tail|clean]"
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 "watch -- Show CLUSTER NODES output (first 30 lines) of first node."
echo "tail <id> -- Run tail -f of instance at base port + ID."