Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
62 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
call_command() { | ||
while [ $((PORT < ENDPORT)) != "0" ]; do | ||
PORT=$((PORT+1)) | ||
redis-cli -p $PORT $2 $3 $4 $5 $6 $7 $8 $9 | ||
done | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
clean_logs_command() { | ||
rm -rf *.log | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
clean_command() { | ||
rm -rf *.log | ||
rm -rf appendonly*.aof | ||
rm -rf dump*.rdb | ||
rm -rf nodes*.conf | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
create_command() { | ||
HOSTS="" | ||
while [ $((PORT < ENDPORT)) != "0" ]; do | ||
PORT=$((PORT+1)) | ||
HOSTS="$HOSTS 127.0.0.1:$PORT" | ||
done | ||
redis-trib create --replicas $REPLICAS $HOSTS | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
start_command() { | ||
while [ $((PORT < ENDPORT)) != "0" ]; do | ||
PORT=$((PORT+1)) | ||
echo "Starting $PORT" | ||
redis-server --port $PORT --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes | ||
done | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
stop_command() { | ||
while [ $((PORT < ENDPORT)) != "0" ]; do | ||
PORT=$((PORT+1)) | ||
echo "Stopping $PORT" | ||
redis-cli -p $PORT shutdown nosave | ||
done | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
tail_command() { | ||
INSTANCE=$2 | ||
PORT=$((PORT+INSTANCE)) | ||
tail -f ${PORT}.log | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
watch_command() { | ||
PORT=$((PORT+1)) | ||
while [ 1 ]; do | ||
clear | ||
date | ||
redis-cli -p $PORT cluster nodes | head -30 | ||
sleep 1 | ||
done | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters