mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
don't use redis-server password for redis-sentinel instances
This commit is contained in:
parent
345ff2c20f
commit
ac8bfd1e15
@ -312,6 +312,7 @@ void Conf::setSentinelServerPool(const ConfParser::Node* node)
|
|||||||
Throw(InvalidValue, "%s:%d HashTag invalid", p->file, p->line);
|
Throw(InvalidValue, "%s:%d HashTag invalid", p->file, p->line);
|
||||||
}
|
}
|
||||||
} else if (setServers(mSentinelServerPool.sentinels, "Sentinels", p)) {
|
} else if (setServers(mSentinelServerPool.sentinels, "Sentinels", p)) {
|
||||||
|
mSentinelServerPool.sentinelPassword = p->val;
|
||||||
} else if (strcasecmp(p->key.c_str(), "Group") == 0) {
|
} else if (strcasecmp(p->key.c_str(), "Group") == 0) {
|
||||||
mSentinelServerPool.groups.push_back(ServerGroupConf{p->val});
|
mSentinelServerPool.groups.push_back(ServerGroupConf{p->val});
|
||||||
if (p->sub) {
|
if (p->sub) {
|
||||||
|
|||||||
@ -65,6 +65,7 @@ struct SentinelServerPoolConf : public ServerPoolConf
|
|||||||
Distribution dist = Distribution::None;
|
Distribution dist = Distribution::None;
|
||||||
Hash hash = Hash::None;
|
Hash hash = Hash::None;
|
||||||
char hashTag[2];
|
char hashTag[2];
|
||||||
|
std::string sentinelPassword;
|
||||||
std::vector<ServerConf> sentinels;
|
std::vector<ServerConf> sentinels;
|
||||||
std::vector<ServerGroupConf> groups;
|
std::vector<ServerGroupConf> groups;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -35,7 +35,7 @@ void SentinelServerPool::init(const SentinelServerPoolConf& conf)
|
|||||||
for (auto& sc : conf.sentinels) {
|
for (auto& sc : conf.sentinels) {
|
||||||
Server* s = new Server(this, sc.addr, true);
|
Server* s = new Server(this, sc.addr, true);
|
||||||
s->setRole(Server::Sentinel);
|
s->setRole(Server::Sentinel);
|
||||||
s->setPassword(sc.password.empty() ? conf.password : sc.password);
|
s->setPassword(sc.password.empty() ? conf.sentinelPassword:sc.password);
|
||||||
mSentinels[i++] = s;
|
mSentinels[i++] = s;
|
||||||
mServs[s->addr()] = s;
|
mServs[s->addr()] = s;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user