mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Adds help to CLUSTER
command
This commit is contained in:
parent
ee3884e63c
commit
bd5af03dbd
@ -4065,7 +4065,34 @@ void clusterCommand(client *c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(c->argv[1]->ptr,"meet") && (c->argc == 4 || c->argc == 5)) {
|
if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) {
|
||||||
|
const char *help[] = {
|
||||||
|
"addslots <slot> [slot ...] -- Assign slots to current node.",
|
||||||
|
"bumpepoch -- Advance the cluster config epoch.",
|
||||||
|
"count-failure-reports <node-id> -- Return number of failure reports for <node-id>.",
|
||||||
|
"countkeysinslot <slot> - Return the number of keys in <slot>.",
|
||||||
|
"delslots <slot> [slot ...] -- Delete slots information from current node.",
|
||||||
|
"failover [force|takeover] -- Promote current slave node to being a master.",
|
||||||
|
"forget <node-id> -- Remove a node from the cluster.",
|
||||||
|
"getkeysinslot <slot> <count> -- Return key names stored by current node in a slot.",
|
||||||
|
"flushslots -- Delete current node own slots information.",
|
||||||
|
"info - Return onformation about the cluster.",
|
||||||
|
"keyslot <key> -- Return the hash slot for <key>.",
|
||||||
|
"meet <ip> <port> [bus-port] -- Connect nodes into a working cluster.",
|
||||||
|
"myid -- Return the node id.",
|
||||||
|
"nodes -- Return cluster configuration seen by node. Output format:",
|
||||||
|
" <id> <ip:port> <flags> <master> <pings> <pongs> <epoch> <link> <slot> ... <slot>",
|
||||||
|
"replicate <node-id> -- Configure current node as slave to <node-id>.",
|
||||||
|
"reset [hard|soft] -- Reset current node (default: soft).",
|
||||||
|
"set-config-epoch <epoch> - Set config epoch of current node.",
|
||||||
|
"setslot <slot> (importing|migrating|stable|node <node-id>) -- Set slot state.",
|
||||||
|
"slaves <node-id> -- Return <node-id> slaves.",
|
||||||
|
"slots -- Return information about slots range mappings. Each range is made of:",
|
||||||
|
" start, end, master and replicas IP addresses, ports and ids",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
addReplyHelp(c, help);
|
||||||
|
} else if (!strcasecmp(c->argv[1]->ptr,"meet") && (c->argc == 4 || c->argc == 5)) {
|
||||||
/* CLUSTER MEET <ip> <port> [cport] */
|
/* CLUSTER MEET <ip> <port> [cport] */
|
||||||
long long port, cport;
|
long long port, cport;
|
||||||
|
|
||||||
@ -4258,7 +4285,7 @@ void clusterCommand(client *c) {
|
|||||||
clusterAddSlot(n,slot);
|
clusterAddSlot(n,slot);
|
||||||
} else {
|
} else {
|
||||||
addReplyError(c,
|
addReplyError(c,
|
||||||
"Invalid CLUSTER SETSLOT action or number of arguments");
|
"Invalid CLUSTER SETSLOT action or number of arguments. Try CLUSTER help");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_UPDATE_STATE);
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_UPDATE_STATE);
|
||||||
@ -4608,7 +4635,9 @@ void clusterCommand(client *c) {
|
|||||||
clusterReset(hard);
|
clusterReset(hard);
|
||||||
addReply(c,shared.ok);
|
addReply(c,shared.ok);
|
||||||
} else {
|
} else {
|
||||||
addReplyError(c,"Wrong CLUSTER subcommand or number of arguments");
|
addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try CLUSTER help",
|
||||||
|
(char*)c->argv[1]->ptr);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user