登录
2017-01-08 15:31:41 来自:什么什么 1 人回应

下面的C#代码可以正常连接:

_cache = new RedisClient(_options.Host, _options.Port, _options.Password);

下面的C#代码连接时

var host = $"{_options.Password}@{_options.Host}:{_options.Port}";
var manager = new RedisManagerPool(host);
var client = manager.GetClient();

报错:

ServiceStack.Redis.RedisResponseException: command role not support for normal user
   at ServiceStack.Redis.RedisNativeClient.ReadComplexResponse() in /opt/lib/teamcity-agent/work/8dcfdcec54d0f21a/src/ServiceStack.Redis/RedisNativeClient_Utils.cs:line 1031

_options.Host 的值是 实例ID.redis.rds.aliyuncs.com 

_options.Password 的值是 实例ID:密码 

2017-01-09 6:45:29 来自:吞吞

RedisConfig.VerifyMasterConnections = false;
// 支持读写分离,均衡负载
return new PooledRedisClientManager(readWriteHosts, readOnlyHosts, new RedisClientManagerConfig
{
MaxWritePoolSize = 20, // “写”链接池链接数
MaxReadPoolSize = 50, // “读”链接池链接数
AutoStart = true,
});

您的回应

你还未登陆,不能回应!登陆