/data/anaconda2/bin/rdb --command json -f 1.csv /tmp/dump.rdb
Cd /data/bak/scripts/redis/redis-rdb-tools
redis-memory-for-key -p 6379 -a xxx key
# redis 5.0以上可以通過如下命令向整個集群執(zhí)行命令:
redis-cli --cluster call <ip>:<port> command -a xxx
# 查看dbsize,已經(jīng)全部清零。
redis-cli --cluster call <ip>:<port> command -a xxx
1、先 把slave kill
2、在哨兵節(jié)點上執(zhí)行
redis-cli -h 10.2.52.162 -p 26388 sentinel reset redis19
redis-cli -h 10.2.53.160 -p 26388 sentinel reset redis19
redis-cli -h 10.2.59.16 -p 26388 sentinel reset redis19
./redis-cli -h 127.0.0.1 -p 6379 -a password --scan --pattern 'key-*' | xargs ./redis-cli -h 127.0.0.1 -p 6379 -a password del {}
#!/bin/bash
nodes_addrs=$(redis-cli -a $3 -h $1 -p $2 cluster nodes|grep -v handshake| awk '{print $2}')
echo $nodes_addrs
for addr in ${nodes_addrs[@]}; do
host=${addr%:*}
port=${addr#*:}
del_nodeids=$(redis-cli -a $3 -h $host -p $port cluster nodes|grep -E 'handshake|fail'| awk '{print $1}')
for nodeid in ${del_nodeids[@]}; do
echo $host $port $nodeid
redis-cli -a $3 -h $host -p $port cluster forget $nodeid
done
done
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。