I have four Severs connected to redis. When the redis server goes down and Comes up. I want to clear the redis database. Issue is that All the servers are firing the clear action. How to handle such that only one servers fires the clear and notifies to all other servers. I am using the StackExchange.Redis and CacheManager.Net Packages as redis client libraries
How to Handle Multiple servers trying to clear the redis Database
715 Views Asked by user1844634 At
1
There are 1 best solutions below
Related Questions in REDIS
- start redis with supervisor
- How to do Mass insertion in Redis using JAVA?
- RedisResponseException: Unknown reply on multi-request
- Redis / Get all keys & values from redis with prefix
- Remove a member from multiple sets in Redis
- Using memcached or Redis on aws-elasticache
- Get Socket Object by Id with node, redis-adapter and socket.io
- how can i save a complex json as string in redis and retrieve it as unescaped legit json object
- How to specify versions on PIP when installing a python package with it's dependencies
- Eloquent model for Redis
- Is exists check required before calling StringSet method of StrackExchange.Redis
- Predis: Pros and Cons of the two cluster strategies
- hmset redis with result from mysqlDB
- does redis cluster support transactions ?
- How change redis to be persistent
Related Questions in STACKEXCHANGE.REDIS
- Is exists check required before calling StringSet method of StrackExchange.Redis
- Deadlock when accessing StackExchange.Redis
- Stackexchange.Redis timeouts & socketfailures
- How to use Queue in StackExchange.Redis
- Can't reconnect to Azure Redis via StackExchange.Redis
- StackExchange.redis not working
- sending hex value over for ZRANGEBYLEX
- Why am I seeing hundreds of aged client connections that appear to be days old?
- Does Azure Redis work over http?
- Unable to connect Twemproxy using StackExchange redis in C#
- Redlock.net can't aquire lock
- StackExchange Redis delete all keys that start with
- azure redis Timeout performing EVAL
- Redis ConnectionMultiplexer firing multiple ConnectionFailed after dispose
- How can I get a key count for StackExchange.Redis?
Related Questions in CACHEMANAGER
- How to choose Redis databaseId in Azure for CacheManager?
- npm cache-manager 'wrap' doesn't exist
- CacheManager handles with inproc and Redis as backplane is not synced
- How modify loaded configuration by CacheManager in runtime
- Using MichaCo\CacheManager with Redis4You and RedisLab redis server
- '_cacheManager == null': is not true audio service issue fix
- CacheManager - Refresh cache every x minutes or on expiration
- How to Handle Multiple servers trying to clear the redis Database
- CompositeCacheManager.getUnconfiguredInstance() API usage
- Should I cache json, Bson or JObject in the ICacheManager?
- Akamai and Jmeter cache manager
- How can I get redis io client from NestJS CacheManager module
- Flutter offline data changes in Hive, ListView UI not updating when data changes using Cache Manager
- Error Adding an Cacheitem using CacheManager
- cachemanager.net - How to get List of objects from redis cache based on key passed?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
To disable any save, set
appendonly noand comment or delete any
saveIf you don't want to disable Redis from saving data, and more in general, you'd have to sync communication somehow, which is not easy as this is a distributed system.
You can try
Adda fake key with CacheManager before clearing the cache. Only one client will be able to write the key, and the Add method returnsFalsein case the key already exists. Meaning, only the first client will write the "lock" and that client then executes theClear.However, this will work only if no FLUSH is performed wile the clients try to Add the item (because the FLUSH would remove that key, too...)
To synchronize that action, you could either wait a few seconds before you clear the cache. Or, you use another Redis database for that "lock" mechanism.
Another option could be using CacheManager's backplane. A clear would fire an event which gets propagated to all connected clients. You could use that to test if another client just cleared the cache. However, that's also not 100% reliable because of the delay and network latency.