Sentinel: added SENTINEL MASTER <name> command.
With SENTINEL MASTERS it was already possible to list all the configured masters, but not a specific one.
This commit is contained in:
parent
2bb9cd464e
commit
c42e4bd0b6
@ -2378,8 +2378,14 @@ void sentinelCommand(redisClient *c) {
|
|||||||
if (!strcasecmp(c->argv[1]->ptr,"masters")) {
|
if (!strcasecmp(c->argv[1]->ptr,"masters")) {
|
||||||
/* SENTINEL MASTERS */
|
/* SENTINEL MASTERS */
|
||||||
if (c->argc != 2) goto numargserr;
|
if (c->argc != 2) goto numargserr;
|
||||||
|
|
||||||
addReplyDictOfRedisInstances(c,sentinel.masters);
|
addReplyDictOfRedisInstances(c,sentinel.masters);
|
||||||
|
} else if (!strcasecmp(c->argv[1]->ptr,"master")) {
|
||||||
|
/* SENTINEL MASTER <name> */
|
||||||
|
sentinelRedisInstance *ri;
|
||||||
|
|
||||||
|
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
|
||||||
|
== NULL) return;
|
||||||
|
addReplySentinelRedisInstance(c,ri);
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"slaves")) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"slaves")) {
|
||||||
/* SENTINEL SLAVES <master-name> */
|
/* SENTINEL SLAVES <master-name> */
|
||||||
sentinelRedisInstance *ri;
|
sentinelRedisInstance *ri;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user