我有一个测试工具,可以反复获取和设置DateTime对象,以便我们可以测试新的Redis Sentinel部署的故障转移。
我已将许可证密钥添加到调用类的静态构造函数中。
我没有进行任何客户端配置,所以它应该使用默认值。
获取和设置99%的时间成功,但我得到了如下所示的间歇性失败。
无法连接:sPort:0
ServiceStack.Redis.RedisException:无法连接:sPort:0
在ServiceStack.Redis.RedisNativeClient.CreateConnectionError()
at ServiceStack.Redis.RedisNativeClient.SendReceive [T](Byte [] [] cmdWithBinaryArgs,Func 1 fn, Action
1 completePipelineFn,Boolean sendWithoutRead)
at ServiceStack.Redis.RedisNativeClient.SendExpectMultiData(Byte [] [] cmdWithBinaryArgs)
at ServiceStack.Redis.RedisNativeClient.SentinelGetMasterAddrByName(String masterName)
at ServiceStack.Redis.RedisSentinelWorker.GetMasterHost(String masterName)
其他帖子声称这可能与ConnectTimeout有关,但我们没有专门设置它,因此应该使用默认值(-1 /未设置)。 问题是什么?
2。无法将类型为'System.Byte []'的对象强制转换为'System.Object []'
2016-07-15 15:00:04,825 ERROR Caching.CacheCore.RedisCacheCore - Get<T> failed with key @#qm:qmth:testhardness-3be0f6bb-5df5-4205-afe4-45ee56b59a71
2016-07-15 15:00:04,825 ERROR Tools.RedisTestHarness.Program - READ - EXCEPTION [Duration: 00:00:00.4976532]: Unable to cast object of type 'System.Byte[]' to type 'System.Object[]'.
2016-07-15 15:00:04,825 DEBUG Tools.RedisTestHarness.Program - at System.Linq.Enumerable.<CastIterator>d__1`1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
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.GetValidSentinelWorker()
at ServiceStack.Redis.RedisSentinel.Start()
at Caching.CacheCore.RedisCacheCore.CreateManagerForSentinel(String connectionString, String sentinelHostFilter)
at Caching.CacheCore.RedisCacheCore.CreateClientManager(String connectionString, Boolean useSentinel, String sentinelHostFilter)
at Caching.CacheCore.RedisCacheCore.GetClient()
at Caching.CacheCore.RedisCacheCore.Get[T](String key)
at Caching.CacheCore.CacheCoreWrapper.<>c__DisplayClass1`1.<Get>b__0()
at Caching.FunctionHandlers.ExecuteFunctionHandler.HandleFunction[T](Func`1 functionToHandle)
at Caching.CacheCore.CacheCoreWrapper.Get[T](String key)
at Caching.Cache.Get[T](String key)
at Tools.RedisTestHarness.Program.Main(String[] args) in ...\Tools.RedisTestHarness\Program.cs:line 123
这对我没有意义。有什么想法吗?
这两个问题都阻碍我们部署到生产阶段。
提前感谢您的帮助。