3

I'm trying to delete all keys on both redis master and slave, but when I'm executing flushall or flushdb from redis-cli on master it deletes keys only on master, or vice versa if I'm deleting keys on slave it deletes keys only on slave.

What command should I use to delete all keys both on master and slave(s)?

Do I need to enable cluster support for this? Cause now it is desabled in my setup.

One more question, why there is no replication in case of using flushall or flushdb from redis-cli?

4

1 回答 1

10

你只需要在每个FLUSHALLmaster上调用或删除所有key,当master与slave同步时,slave会删除所有key。但是,您必须确保主从之间的连接是活动的。FLUSHDB

如果你在slave上调用这两个命令(当然slave必须是可写的),master上的keys不会被删除。

于 2017-05-12T06:09:55.050 回答