How to clear redis cache keys in Sentinel redis

796 views
Skip to first unread message

leo f

unread,
May 24, 2017, 4:21:41 PM5/24/17
to Redis DB
hi, 

For standalone redis server, i was able to flush specific keys for the client which is connected to the redis server using redis-cli command
to flush redis db . 
 
I am new to Sentinel redis server, how does this work in a sentinel env where we have 1 master and 2 slaves. 
Is CLIENT KILL the solution? 

Thanks

hva...@gmail.com

unread,
May 24, 2017, 10:51:27 PM5/24/17
to Redis DB
If I understand your question properly, no, CLIENT KILL is not the solution.  You don't do anything different.

Sentinel manages replication between Redis servers.  Sentinel controls the configuration of the Redis servers - which of them is the master, and which are the slaves.  Sentinel does not modify the data in the Redis servers that your client writes and reads.

Since Sentinel decides which of the Redis servers is master and which are slaves, your clients will need to ask Sentinel for that information.  If a server fails, your clients will find out the new master/slave arrangement from Sentinel and connect to the right servers.

leo f

unread,
May 25, 2017, 11:17:11 AM5/25/17
to Redis DB
Thank you for taking the time and responding to my question. 

Just want to clear up one thing. You may or may not know when using standalone redis server, one can use redis-cli to query the redis server for the
regexp named cache entries and then delete those entries with --raw keys. Are you saying in your response, this is not possible anymore
and it is up to client to query the sentinel redis server to see who is the master and then execute redis-cli to clear the cache db?
I am just wondering if --raw keys is supported by the redis-cli ? i did not see it . 


thanks
leo
Reply all
Reply to author
Forward
0 new messages