I have been trying to get the ASP.NET Redis Session State provider configured in my application for some time. Finally, I was able to successfully connect directly to the wizard and set / get the keys thanks to this message: Unable to connect to the Redis server using ASP.NET Session State Provider
Now, my next question is ... get this to work with the Sentinel configuration.
I am familiar with the SENTINEL get-master-addr-by-name master-dev-sessionstate command to define a master. Does this provider have this built-in? Based on the comments on the blog post linked above (this is also ONLY the documentation I can find on this), it looks like I should use the connectionString attribute to transfer multiple hosts. I'm not sure if these few hosts are for Sentinels or not.
<connectionStrings> <add name="RedisConnection" connectionString="1.2.3.4:5,6.7.8.9:10,abortConnect=false,ssl=false,password=XXXXXX,operationTimeoutInMilliseconds=5000"/> </connectionStrings> <sessionState mode="Custom" customProvider="MySessionStateStore"> <providers> <clear/> <add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" connectionString="RedisConnection"/> </providers> </sessionState>
When setting up my connection like this, I get this error:
Additional Information: Failed to connect to redis Server (s); To create a disabled multiplexer, disable AbortOnConnectFail.
I get this error even if I only have the primary IP address in my connection string. As you can see above, I have abortConnect = "false" in my connection string, which teaches me how to do it. The same error occurs with or without this in the connection string.
With that in mind, here are my questions ...
- Does this provider support Sentinel configuration?
- If so, what is the correct format for the connection string?
- Does anyone have any other good documentation resources? I couldn’t even find anything on the Microsoft site beyond this blog post.
EDIT: I should point out that this is a typical local Redis installation. We do not go through Azure.
EDIT: Recently, I tried to point my working configuration to Sentinel, and I get "No connection to service this operation: EVAL." This makes me think that this provider does not have Sentinel support. Can anyone confirm this?