Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

.Net Core Implementing Redis cashing with master and slave connections

$
0
0

I need to use redis connection with Master and Slave configuration in dot net core.

Below code is configured to get the primary server(Master) which is configured to port 6379, and I have a slave configured to 6380.

services.AddSingleton < IDistributedCache > (serviceProvider =>
 new RedisCache(new RedisCacheOptions {
    Configuration = primaryServer.ConnectionString,
    InstanceName = primaryServer.InstanceName
 }));

Below is the configuration:

"RedisSettings": {
  "PrimaryServer": {
    "ConnectionString": "127.0.0.1:6379",
      "InstanceName": "SomeName"
  },
    "SecondaryServer": {
      "ConnectionString": "127.0.0.1:6380",
        "InstanceName": "SomeName"
    }
}

Let me know if it is possible to have a master and slave setup for IDistributedCache


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>