| 3522 | } |
| 3523 | |
| 3524 | void sentinelCommand(client *c) { |
| 3525 | if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) { |
| 3526 | const char *help[] = { |
| 3527 | "CKQUORUM <master-name>", |
| 3528 | " Check if the current Sentinel configuration is able to reach the quorum", |
| 3529 | " needed to failover a master and the majority needed to authorize the", |
| 3530 | " failover.", |
| 3531 | "CONFIG SET <param> <value>", |
| 3532 | " Set a global Sentinel configuration parameter.", |
| 3533 | "CONFIG GET <param>", |
| 3534 | " Get global Sentinel configuration parameter.", |
| 3535 | "GET-MASTER-ADDR-BY-NAME <master-name>", |
| 3536 | " Return the ip and port number of the master with that name.", |
| 3537 | "FAILOVER <master-name>", |
| 3538 | " Manually failover a master node without asking for agreement from other", |
| 3539 | " Sentinels", |
| 3540 | "FLUSHCONFIG", |
| 3541 | " Force Sentinel to rewrite its configuration on disk, including the current", |
| 3542 | " Sentinel state.", |
| 3543 | "INFO-CACHE <master-name>", |
| 3544 | " Return last cached INFO output from masters and all its replicas.", |
| 3545 | "IS-MASTER-DOWN-BY-ADDR <ip> <port> <current-epoch> <runid>", |
| 3546 | " Check if the master specified by ip:port is down from current Sentinel's", |
| 3547 | " point of view.", |
| 3548 | "MASTER <master-name>", |
| 3549 | " Show the state and info of the specified master.", |
| 3550 | "MASTERS", |
| 3551 | " Show a list of monitored masters and their state.", |
| 3552 | "MONITOR <name> <ip> <port> <quorum>", |
| 3553 | " Start monitoring a new master with the specified name, ip, port and quorum.", |
| 3554 | "MYID", |
| 3555 | " Return the ID of the Sentinel instance.", |
| 3556 | "PENDING-SCRIPTS", |
| 3557 | " Get pending scripts information.", |
| 3558 | "REMOVE <master-name>", |
| 3559 | " Remove master from Sentinel's monitor list.", |
| 3560 | "REPLICAS <master-name>", |
| 3561 | " Show a list of replicas for this master and their state.", |
| 3562 | "RESET <pattern>", |
| 3563 | " Reset masters for specific master name matching this pattern.", |
| 3564 | "SENTINELS <master-name>", |
| 3565 | " Show a list of Sentinel instances for this master and their state.", |
| 3566 | "SET <master-name> <option> <value>", |
| 3567 | " Set configuration paramters for certain masters.", |
| 3568 | "SIMULATE-FAILURE (CRASH-AFTER-ELECTION|CRASH-AFTER-PROMOTION|HELP)", |
| 3569 | " Simulate a Sentinel crash.", |
| 3570 | NULL |
| 3571 | }; |
| 3572 | addReplyHelp(c, help); |
| 3573 | } else if (!strcasecmp(c->argv[1]->ptr,"masters")) { |
| 3574 | /* SENTINEL MASTERS */ |
| 3575 | if (c->argc != 2) goto numargserr; |
| 3576 | addReplyDictOfRedisInstances(c,sentinel.masters); |
| 3577 | } else if (!strcasecmp(c->argv[1]->ptr,"master")) { |
| 3578 | /* SENTINEL MASTER <name> */ |
| 3579 | sentinelRedisInstance *ri; |
| 3580 | |
| 3581 | if (c->argc != 3) goto numargserr; |
nothing calls this directly
no test coverage detected