From 31c079cc714fa5a8a173ea9b2f134ec5bf53432c Mon Sep 17 00:00:00 2001 From: Wen Hui Date: Sat, 8 Aug 2020 15:28:44 -0400 Subject: [PATCH] add sentinel command help (#7579) --- src/sentinel.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/sentinel.c b/src/sentinel.c index 5bd594955..d93b26131 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -3044,7 +3044,30 @@ int sentinelIsQuorumReachable(sentinelRedisInstance *master, int *usableptr) { } void sentinelCommand(client *c) { - if (!strcasecmp(c->argv[1]->ptr,"masters")) { + if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) { + const char *help[] = { +"MASTERS -- Show a list of monitored masters and their state.", +"MASTER -- Show the state and info of the specified master.", +"REPLICAS -- Show a list of replicas for this master and their state.", +"SENTINELS -- Show a list of Sentinel instances for this master and their state.", +"IS-MASTER-DOWN-BY-ADDR -- Check if the master specified by ip:port is down from current Sentinel's point of view.", +"GET-MASTER-ADDR-BY-NAME -- Return the ip and port number of the master with that name.", +"RESET -- Reset masters for specific master name matching this pattern.", +"FAILOVER -- Manually failover a master node without asking for agreement from other Sentinels", +"PENDING-SCRIPTS -- Get pending scripts information.", +"MONITOR -- Start monitoring a new master with the specified name, ip, port and quorum.", +"FLUSHCONFIG -- Force Sentinel to rewrite its configuration on disk, including the current Sentinel state.", +"REMOVE -- Remove master from Sentinel's monitor list.", +"CKQUORUM -- Check if the current Sentinel configuration is able to reach the quorum needed to failover a master " +"and the majority needed to authorize the failover.", +"SET