Hello,
Is scenario supported? We have a multiple environments where we’d like to share the group of machines. I know we could come up with some type of naming convention so the keys don’t collide, but I’d prefer a separate database.
After digging a bit into the source code I also can’t infer if Sentinel returns a pooled manager or not. e.g.
var sentinelHosts = container.Resolve<IAppSettings>()
.GetString("Redis:Sentinel:Hosts").Split(',');
var sentinel = new RedisSentinel(sentinelHosts, "master");
var redisManager = sentinel.Start();
container.Register(redisManager);
because I have a hunch that changing the database will be a the responsibility of the client manager.
Update1: Reading the source code, I found this in the RedisSentinelWorker…doesn’t look good for the home team
public RedisSentinelWorker(RedisSentinel redisSentinel, string host, string masterName)
{
this.redisSentinel = redisSentinel;
this.redisManager = redisSentinel.RedisManager;
this.masterName = masterName;
//Sentinel Servers doesn't support DB, reset to 0
var sentinelEndpoint = host.ToRedisEndpoint(defaultPort:RedisNativeClient.DefaultPortSentinel);
this.sentinelClient = new RedisClient(sentinelEndpoint) { Db = 0 };
this.sentinelPubSubClient = new RedisClient(sentinelEndpoint) { Db = 0 };
this.sentinelSubscription = this.sentinelPubSubClient.CreateSubscription();
this.sentinelSubscription.OnMessage = SentinelMessageReceived;
if (Log.IsDebugEnabled)
Log.Debug("Set up Redis Sentinel on {0}".Fmt(host));
}
Thank you,
Stephen