I have tested the implemention using the development kit setup by ServiceStack, redis-config Git repository which is excellent - thank you. This works perfectly.
When I try and use this on my test environment, which has 1 master, 1 slave, and 3 sentinels I get the following exception:
ServiceStack.Redis.RedisException: No Redis Sentinels were available ---> ServiceStack.Redis.RedisResponseException: No such master with that name
at ServiceStack.Redis.RedisNativeClient.CreateResponseError(String error)
at ServiceStack.Redis.RedisNativeClient.ReadDeeplyNestedMultiDataItem()
at ServiceStack.Redis.RedisNativeClient.ReadDeeplyNestedMultiData()
at ServiceStack.Redis.RedisNativeClient.SendReceive[T](Byte[][] cmdWithBinaryArgs, Func`1 fn, Action`1 completePipelineFn, Boolean sendWithoutRead)
at ServiceStack.Redis.RedisNativeClient.SendExpectDeeplyNestedMultiData(Byte[][] cmdWithBinaryArgs)
at ServiceStack.Redis.RedisNativeClient.SentinelSlaves(String masterName)
at ServiceStack.Redis.RedisSentinelWorker.GetSlaveHosts(String masterName)
at ServiceStack.Redis.RedisSentinelWorker.GetSentinelInfo()
at ServiceStack.Redis.RedisSentinel.GetSentinelInfo()
at ServiceStack.Redis.RedisSentinel.GetRedisManager()
at ServiceStack.Redis.RedisSentinel.GetValidSentine...
Which is strange, according to the docs, the client should connect to a sentinel and execute SENTINEL masters
which in my case returns:
R:\Redis>redis-cli -h redistest1 -p 26379
redis redistest1:26379> SENTINEL masters
1) 1) "name"
2) "redistest1"
3) "ip"
4) "192.168.16.85"
5) "port"
6) "6379"
etc....
I believe ServiceStack is doing this part. It should then request SENTINEL get-master-addr-by-name redistest1
which returns:
redis redistest1:26379> SENTINEL get-master-addr-by-name redistest1
1) "192.168.16.85"
2) "6379"
However according to ServiceStack the sentinel returns No such master with specified name
. I cannot enable monitor on the sentinels as they do not support this command too see what is actually being requested. The sentinel log files contain no information. The redis/sentinel VMs are accessable by the host VM (it was previously accessing redistest1
without sentinel support).
Edit: I am not specifying a master name when setting up the RedisManagerPool, as I do not believe this is required.
What could I be missing here? What is the next step to debugging my configuration?
Many thanks,
James