Commit 52cf0975 authored by antirez's avatar antirez
Browse files

Sentinel: added SENTINEL MASTER <name> command.

With SENTINEL MASTERS it was already possible to list all the configured
masters, but not a specific one.
parent 6bcc370c
...@@ -2380,8 +2380,14 @@ void sentinelCommand(redisClient *c) { ...@@ -2380,8 +2380,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment