/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以上可以通過(guò)如下命令向整個(gè)集群執(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é)點(diǎn)上執(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 {}
- 集群刪除handshake節(jié)點(diǎn)
#!/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)容合作請(qǐng)聯(lián)系作者