我正在将系统转向生产,其中一部分涉及将用于身份验证缓存的 REDIS 服务器从在开发盒上运行的服务更改为更合适的环境。新盒子是一对(目前)配置为带有密码的主机和从机
我连接到 REDIS 的代码遵循标准模式:
container.Register<IRedisClientsManager>(c => new PooledRedisClientManager("localhost:6379"));
container.Register<ICacheClient>(c => (ICacheClient)c.Resolve<IRedisClientsManager>().GetCacheClient());
对于新盒子,我已将其修改为:
string[] ReadWriteHosts = new[] {
"XYZ@10.10.10.10:6379"
};
string[] ReadOnlyHosts = new[] {
"XYZ@10.10.10.11:6379"
};
var REDISClientManager = new PooledRedisClientManager(ReadWriteHosts, ReadOnlyHosts);
container.Register<IRedisClientsManager>(REDISClientManager);
container.Register<ICacheClient>(c => (ICacheClient)c.Resolve<IRedisClientsManager>().GetCacheClient());
当我启动应用程序并尝试登录时,我收到:
'base.UserSession' threw an exception of type 'ServiceStack.Redis.RedisResponseException'
"Client sent AUTH, but no password is set, sPort: 0, LastCommand: "
我还没有设法一直遵循它,只是想知道是否有人能看到任何明显错误的东西。