mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
support connect to sentinel instance with password
This commit is contained in:
parent
393ff81e69
commit
bc0bc42625
@ -253,6 +253,7 @@ predixy支持Redis Sentinel和Redis Cluster来使用redis,一个配置里这
|
|||||||
+ ServerRetryTimeout: 一个redis实例失效后多久后去检查其是否恢复正常,不指定的话为1秒
|
+ ServerRetryTimeout: 一个redis实例失效后多久后去检查其是否恢复正常,不指定的话为1秒
|
||||||
+ KeepAlive: predixy与redis的连接tcp keepalive时间,为0则禁止此功能,不指定的话为0
|
+ KeepAlive: predixy与redis的连接tcp keepalive时间,为0则禁止此功能,不指定的话为0
|
||||||
+ Sentinels: 里面定义redis sentinel实例的地址
|
+ Sentinels: 里面定义redis sentinel实例的地址
|
||||||
|
+ 从redis 5.0开始,sentinel进程支持配置连接密码(通过在sentinel的配置文件里,不是predixy的配置文件,设置requirepass anypwd这样的配置项实现), 在这种情况下需要在Sentinels里以 + {anypwd}@{address}:{port}的形式配置sentinel的连接地址
|
||||||
+ Group: 定义一个redis组,Group的名字应该和redis sentinel里面的名字一致,Group里可以显示列出redis的地址,列出的话就是上面提到的静态节点
|
+ Group: 定义一个redis组,Group的名字应该和redis sentinel里面的名字一致,Group里可以显示列出redis的地址,列出的话就是上面提到的静态节点
|
||||||
|
|
||||||
一个例子:
|
一个例子:
|
||||||
|
|||||||
@ -331,8 +331,8 @@ void Conf::setStandaloneServerPool(const ConfParser::Node* node)
|
|||||||
} else {
|
} else {
|
||||||
Throw(InvalidValue, "%s:%d HashTag invalid", p->file, p->line);
|
Throw(InvalidValue, "%s:%d HashTag invalid", p->file, p->line);
|
||||||
}
|
}
|
||||||
} else if (setServers(mStandaloneServerPool.sentinels, "Sentinels", p)) {
|
} else if (strcasecmp(p->key.c_str(), "Sentinels") == 0) {
|
||||||
mStandaloneServerPool.sentinelPassword = p->val;
|
setServers(mStandaloneServerPool.sentinels, "Sentinels", p);
|
||||||
} else if (strcasecmp(p->key.c_str(), "Group") == 0) {
|
} else if (strcasecmp(p->key.c_str(), "Group") == 0) {
|
||||||
mStandaloneServerPool.groups.push_back(ServerGroupConf{p->val});
|
mStandaloneServerPool.groups.push_back(ServerGroupConf{p->val});
|
||||||
if (p->sub) {
|
if (p->sub) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user