locked
Redis SessionStateProvider + On-premise clustering RRS feed

  • Question

  • hi,

    I'm posting this question here because i could not find any documentation regarding on-premise redis clustering support for the sessionstateprovider library.

    I tried to get the sessionstateprovider to run on top of a redis cluster (using redis's own clustering with 3 master shards + replicas).

    From what I could gather the sessionstate library uses stackexchange.redis connectionmultiplexer to connect to redis, which by itself detects and supprots clustering (for availablility we added all shard master + replicas to the connection string).

    When using this cluster with the sessionstateprovider we get "write to slave errors", which makes me think that redis clustering is not supported, but I do not understand why that is, since the stackexchange.redis connectionmultiplexer should hide/abstract the fact that a cluster is used behind the scenes.

    So it looks like I'm missing something here in understanding what is going on and I'm not sure where to go from here. I see from comments in the source code that twemproxy and sentinel are supported, so I guess I could set up a cluster that way as well even though it means slightly more work than using the build-in clustering mechanism.

    We are currently using StackExchange.Redis.StrongName v1.2.6 and SessionStateProvider v3.0.2

    Cheers,
    Martin

    Tuesday, November 13, 2018 9:23 AM

Answers

  • Hi Martin,

    This would actually be a better post in Stack Overflow but, I didn't see anything specific to your situation. You may want to present this question on that forum. 

    Step 4 of the following documentation goes over the Master/Slave configuration. I am using this here as a reference to ensure that aspect of your solution is correctly configured.

    How To Configure a Redis Cluster on Ubuntu 14.04

    In looking at the StackExchange.Redis Configuration, there is no example of how to pass multiple connection strings in the connectionmultiplexer. In the case of Azure, much of the service is managed for you, such as clustering. 

    Regards,

    Mike

    Tuesday, November 13, 2018 6:00 PM

All replies

  • Hi Martin,

    This would actually be a better post in Stack Overflow but, I didn't see anything specific to your situation. You may want to present this question on that forum. 

    Step 4 of the following documentation goes over the Master/Slave configuration. I am using this here as a reference to ensure that aspect of your solution is correctly configured.

    How To Configure a Redis Cluster on Ubuntu 14.04

    In looking at the StackExchange.Redis Configuration, there is no example of how to pass multiple connection strings in the connectionmultiplexer. In the case of Azure, much of the service is managed for you, such as clustering. 

    Regards,

    Mike

    Tuesday, November 13, 2018 6:00 PM
  • Hi,,

    thanks, Mike.

    I have now actually gone back one step and created a minimal web app from scratch with a redis cluster and it seems to work as  I expect I would (guess that would've been a better first step, but it seemed so straight forward to replace one distributed cache with another on a rather big web app...).

    Which means there is probably another reason for the issues we are facing and they are not directly related to the sessionstateprovicder or the redis clustering by itself.

    Regards,

    Martin

    Tuesday, November 13, 2018 7:40 PM