| 4421 | } |
| 4422 | |
| 4423 | void clusterCommand(client *c) { |
| 4424 | if (server.cluster_enabled == 0) { |
| 4425 | addReplyError(c,"This instance has cluster support disabled"); |
| 4426 | return; |
| 4427 | } |
| 4428 | |
| 4429 | if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) { |
| 4430 | const char *help[] = { |
| 4431 | "ADDSLOTS <slot> [<slot> ...]", |
| 4432 | " Assign slots to current node.", |
| 4433 | "BUMPEPOCH", |
| 4434 | " Advance the cluster config epoch.", |
| 4435 | "COUNT-FAILURE-REPORTS <node-id>", |
| 4436 | " Return number of failure reports for <node-id>.", |
| 4437 | "COUNTKEYSINSLOT <slot>", |
| 4438 | " Return the number of keys in <slot>.", |
| 4439 | "DELSLOTS <slot> [<slot> ...]", |
| 4440 | " Delete slots information from current node.", |
| 4441 | "FAILOVER [FORCE|TAKEOVER]", |
| 4442 | " Promote current replica node to being a master.", |
| 4443 | "FORGET <node-id>", |
| 4444 | " Remove a node from the cluster.", |
| 4445 | "GETKEYSINSLOT <slot> <count>", |
| 4446 | " Return key names stored by current node in a slot.", |
| 4447 | "FLUSHSLOTS", |
| 4448 | " Delete current node own slots information.", |
| 4449 | "INFO", |
| 4450 | " Return information about the cluster.", |
| 4451 | "KEYSLOT <key>", |
| 4452 | " Return the hash slot for <key>.", |
| 4453 | "MEET <ip> <port> [<bus-port>]", |
| 4454 | " Connect nodes into a working cluster.", |
| 4455 | "MYID", |
| 4456 | " Return the node id.", |
| 4457 | "NODES", |
| 4458 | " Return cluster configuration seen by node. Output format:", |
| 4459 | " <id> <ip:port> <flags> <master> <pings> <pongs> <epoch> <link> <slot> ...", |
| 4460 | "REPLICATE <node-id>", |
| 4461 | " Configure current node as replica to <node-id>.", |
| 4462 | "RESET [HARD|SOFT]", |
| 4463 | " Reset current node (default: soft).", |
| 4464 | "SET-CONFIG-EPOCH <epoch>", |
| 4465 | " Set config epoch of current node.", |
| 4466 | "SETSLOT <slot> (IMPORTING|MIGRATING|STABLE|NODE <node-id>)", |
| 4467 | " Set slot state.", |
| 4468 | "REPLICAS <node-id>", |
| 4469 | " Return <node-id> replicas.", |
| 4470 | "SAVECONFIG", |
| 4471 | " Force saving cluster configuration on disk.", |
| 4472 | "SLOTS", |
| 4473 | " Return information about slots range mappings. Each range is made of:", |
| 4474 | " start, end, master and replicas IP addresses, ports and ids", |
| 4475 | NULL |
| 4476 | }; |
| 4477 | addReplyHelp(c, help); |
| 4478 | } else if (!strcasecmp(c->argv[1]->ptr,"meet") && (c->argc == 4 || c->argc == 5)) { |
| 4479 | /* CLUSTER MEET <ip> <port> [cport] */ |
| 4480 | long long port, cport; |
nothing calls this directly
no test coverage detected