1

Using ServiceStack version 4.0.40.

I am trying get RedisSentinel to use the RedisManagerPool instead of the PooledRedisClientManager so it will allow clients above the client pool size.

I see this in the docs to set this...

sentinel.RedisManagerFactory = (master,slaves) => new RedisManagerPool(master);

I'm not sure how to use this. Do I pass in the master host name? What if I don't know which is master because of a previous failover? I can't sentinel.start() to find out which is master because it will start with the PooledRedisClientManager, which isn't what I want.

Or, do I pass in the sentinel hosts? RedisManagerPool takes a list of hosts, I can pass in the sentinel hosts, but I cannot set it to sentinel.RedisManagerFactory as RedisManagerFactory is not convertible to RedisManagerPool.

I think I am missing something simple here. Any help appreciated.

UPDATE

As per mythz's comment below, this isn't available in version 4.0.40 of ServiceStack. But you can use;

  sential.RedisManagerFactory.FactoryFn = (master, slaves) => new RedisManagerPool(master);

Thanks

Dan
  • 1,450
  • 1
  • 17
  • 34

1 Answers1

0

This is literally the config you need to use to change RedisSentinel to use RedisManagerPool:

sentinel.RedisManagerFactory = (master,slaves) => 
    new RedisManagerPool(master);

You don’t need to pass anything else, the master host argument uses the lambda argument.

mythz
  • 141,670
  • 29
  • 246
  • 390
  • I get the error 'Cannot convert lamda expression of type 'RedisManagerFactory' because it is not a delegate type' – Dan Mar 06 '18 at 13:00
  • @Dan then your version is too old and doesn’t support it. – mythz Mar 06 '18 at 13:04
  • At which version did you start supporting it? Is there another way of setting the max client pool size in version 4.0.40? – Dan Mar 06 '18 at 13:05
  • @Dan I don’t recall and looks like you can use `RedisManagerFactory.FactoryFn = (master,slaves) => new RedisManagerPool(master);` in v4.0.40. – mythz Mar 06 '18 at 13:20