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
716 Views Asked by user1844634 At
1
There are 1 best solutions below
Related Questions in REDIS
- How to Socket.IO Multithreading on a Raspberry Pi?
- How to get the session ID returned by cookie with spring-session-data-redis
- Cannot serialize (Spring Boot)
- JEDIS/REDIS 'ON' Keyword or broken query?
- Quart_Sessions Redis deletes keys and create backups instead
- Docker builds redis, mounts the host network and uses 192.168.*.* to access the redis server and is denied
- Need a script to fetch the redis latency values over 20 seconds and store the results in a file
- Service in Docker Compose not connecting to Redis container in docker, Failed to connect to any host resolved for DNS name
- Install redis vector database on GCP in a GKE cluster
- how to avoid while loop while waiting for future complete?
- Is it possible to append the data in Redis command
- Not able to inject RedisCache/SyncCache/StatefulRedisConnection beans in micronaut 4.2.1 version
- RedisConnectionFailureException intermittently
- using redis timeseries in aredes error =>Error handling publish event: [ErrorReply: ERR TSDB: invalid value]
- HttpResponseMessage caching using redis
Related Questions in STACKEXCHANGE.REDIS
- StackExchange.Redis Timeout Exceptions (ASP.NET Core 6 MVC)
- Why signal R app throwing SocketClosed exception for RedisConnection(in aws) for and state is "ConnectedEstablished" and app works fine?
- How to check if SignalR is using redis elasticache programmatically in C#. Is there any code to get stored key value pairs
- Is there a way to add List<T> to redis in c#?
- Redis Stream I need Event Driven Architecture,
- REDIS Keys in Kubernetes deleted after 24 hours of migrating to Azure Cache for Redis
- Method not found using StackExchange.Redis
- How to pass Expire to Json key in NRedisStack?
- How to save user multiple sessions in the redis cache?
- Facing issue with HttpClient timeout when reference is added to StackExchange.Redis in the project
- How to Retrieve Json List Filtered in Redis?
- How does StackExchange.Redis store data in Redis in HashMap?
- Why am i getting a redis timeout error when multi threading with the stackexchange.redis multiplexer?
- unit tests using StackExchange.Redis
- StackExchange.Redis.TimeoutException
Related Questions in CACHEMANAGER
- Why Flutter_Cache_Manager isn't deleting cached files
- Flutter: How to extend the age of the cached image
- npm cache-manager 'wrap' doesn't exist
- Flutter offline data changes in Hive, ListView UI not updating when data changes using Cache Manager
- CacheManger defined as bean and in application.yaml
- How to create RedisCacheManager in spring-data 3.0.x
- Handshake error in flutter while loading image via cached_image_network
- '_cacheManager == null': is not true audio service issue fix
- EhCache 3.9 -- Get All Cache Entries (working in EhCache 2.10)
- How can I get redis io client from NestJS CacheManager module
- Autowire CacheManger (Caffeine & Ehcache) without using @SpringBootApplication
- No CacheResolver specified, and no unique bean of type CacheManager found
- How to cache millions of records in cache of CacheManager when using JdbcPagingItemReader?
- How can I cache username and login to display in the LoginSuccess class?
- How can be automatically loaded the necessary map stored in memory?
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 # Hahtags
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.