How to specify Multiple Ips in Web.config file for Redis-Cluster

766 views
Skip to first unread message

shyamal....@gmail.com

unread,
May 26, 2016, 12:25:13 PM5/26/16
to Redis DB
Hi ,

I Have configured  Redis master - slave  with 0ne master and 2 slaves . i also setup 3 sentinels and it is working fine . as one goes down sentnel make other master.
i am using aps.net mvc appication and i am pointing to one redis server by specifiying ip in config file for session store.but if the pointed redis server goes down then my application throws error and not working as it is pointing to the redis-server for session state management. 
so my question is how to specifies redis servers ips which are in cluster configuraion in web.config file so that if one redis server will down then it will point to other master made by sentinel?

Quick response is appriciated.

Thanks,
Shyamal Gajjar.
(Sr.Softwar Engineer)

AlexanderB

unread,
May 26, 2016, 1:53:44 PM5/26/16
to Redis DB
I'm not familiar with the asp.net plugin, but in general when using sentinel, the idea is to use a redis client with sentinel support, and instead of connecting to the redis servers directly, instead connecting all clients through the sentinel servers. 

New clients connect to the sentinel servers to get info on the current master before talking to it, and will need to register for notifications from sentinel on failover events. This a lot more work on the client, and the one backed into asp.net might no support it. 

Edit: Looking around on google it looks like the default asp.net session store doesn't have sentinel support built in. http://stackoverflow.com/questions/32354208/configure-asp-net-redis-session-state-provider-for-sentinel-configuration

Microsoft likely wants you to upgrade to azure cache if you want failover, or otherwise you'll need to build you own caching directly with a Redis client that provides sentinel support. A lot more work than the plug and play session store solution. 
Reply all
Reply to author
Forward
0 new messages