当前位置:网站首页>Redis daily notes

Redis daily notes

2022-07-04 14:21:00 Ke Rui

1.redis colony Clean all key

redis 5.0 The above can be executed to the whole cluster through the following commands flushall command :

redis-cli --cluster call <one-of-the-nodes-address>:<its-port> FLUSHALL

Examples are as follows :

adopt –cluster Parameters sent to the cluster flushall command :

[[email protected] hermes_ta]# redis-cli --cluster call 127.0.0.1:7000 flushall
>>> Calling flushall
127.0.0.1:7000: READONLY You can't write against a read only replica. 127.0.0.1:7003: READONLY You can't write against a read only replica.

127.0.0.1:7004: READONLY You can't write against a read only replica. 127.0.0.1:7007: OK 127.0.0.1:7006: READONLY You can't write against a read only replica.

127.0.0.1:7002: OK
127.0.0.1:7005: OK
127.0.0.1:7001: OK

see dbsize, All have been cleared .

[[email protected] hermes_ta]# redis-cli --cluster call 127.0.0.1:7000 dbsize
>>> Calling dbsize
127.0.0.1:7000: 0
127.0.0.1:7003: 0
127.0.0.1:7004: 0
127.0.0.1:7007: 0
127.0.0.1:7006: 0
127.0.0.1:7002: 0
127.0.0.1:7005: 0
127.0.0.1:7001: 0
原网站

版权声明
本文为[Ke Rui]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041228387258.html