Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can cont create cluster #6178

Open
cihantunali opened this issue Jun 23, 2019 · 3 comments
Open

Can cont create cluster #6178

cihantunali opened this issue Jun 23, 2019 · 3 comments

Comments

@cihantunali
Copy link

Hello,
Im using redis 5.0.5 at two servers with 3 instances on each server. Now, im trying to create cluster via redis-cli --cluster create command, it says "(error) ERR Unknown subcommand or wrong number of arguments for 'create'. Try CLUSTER HELP."

When i check cluster commands i could not find create command.
127.0.0.1:6379> cluster help

  1. CLUSTER arg arg ... arg. Subcommands are:
  2. ADDSLOTS [slot ...] -- Assign slots to current node.
  3. BUMPEPOCH -- Advance the cluster config epoch.
  4. COUNT-failure-reports -- Return number of failure reports for .
  5. COUNTKEYSINSLOT - Return the number of keys in .
  6. DELSLOTS [slot ...] -- Delete slots information from current node.
  7. FAILOVER [force|takeover] -- Promote current replica node to being a master.
  8. FORGET -- Remove a node from the cluster.
  9. GETKEYSINSLOT -- Return key names stored by current node in a slot.
  10. FLUSHSLOTS -- Delete current node own slots information.
  11. INFO - Return onformation about the cluster.
  12. KEYSLOT -- Return the hash slot for .
  13. MEET [bus-port] -- Connect nodes into a working cluster.
  14. MYID -- Return the node id.
  15. NODES -- Return cluster configuration seen by node. Output format:
  16. <id> <ip:port> <flags> <master> <pings> <pongs> <epoch> <link> <slot> ... <slot>
    
  17. REPLICATE -- Configure current node as replica to .
  18. RESET [hard|soft] -- Reset current node (default: soft).
  19. SET-config-epoch - Set config epoch of current node.
  20. SETSLOT (importing|migrating|stable|node ) -- Set slot state.
  21. REPLICAS -- Return replicas.
  22. SLOTS -- Return information about slots range mappings. Each range is made of:
  23. start, end, master and replicas IP addresses, ports and ids
    

Can you help please?

@artix75
Copy link
Contributor

artix75 commented Jun 24, 2019

The --cluster option in redis-cli is not the CLUSTER command of Redis. Is an option used by redis-cli in order to manage a cluster.
Don't use it as a Redis command and don't enter redis-cli in repl mode.

To create a cluster, launch redis-cli with these options:

redis-cli --cluster create NODE_ADDR1 NODE_ADDR2 ...

Example:

redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003

You can specify the number of replicas per node with --cluster-replicas, ie:

redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006 --cluster-replicas 2

To see all --cluster subcommands:

redis-cli --cluster help

@joshgies-xad
Copy link

joshgies-xad commented Sep 1, 2019

Using this, at least in aws, is super flaky. I either get it returning immediately to the command prompt after typing yes, or get the following, where the cluster never completes creation (cluster is "ok", but has 6 masters, no replicas)

>>> Performing hash slots allocation on 6 nodes...
Master[0] -> Slots 0 - 5460
Master[1] -> Slots 5461 - 10922
Master[2] -> Slots 10923 - 16383
Adding replica 172.17.32.101:6381 to 172.17.30.175:6380
Adding replica 172.17.34.186:6381 to 172.17.32.101:6380
Adding replica 172.17.30.175:6381 to 172.17.34.186:6380
M: e17471ea78baf8b361ed89ae981aa6a2a3d67b1d 172.17.30.175:6380
   slots:[0-5460] (5461 slots) master
S: c5e4afa7739ac985a7df62125efea3d5ef5cd2f8 172.17.30.175:6381
   replicates 97e7c990cb0de29130b396459f275ce0062fc10c
M: 4cb5e4bf468a7fd89f10499a298b51e8472644a4 172.17.32.101:6380
   slots:[5461-10922] (5462 slots) master
S: 7dd79d5a668ef9b05b79a94e4a5de7988e911b71 172.17.32.101:6381
   replicates e17471ea78baf8b361ed89ae981aa6a2a3d67b1d
M: 97e7c990cb0de29130b396459f275ce0062fc10c 172.17.34.186:6380
   slots:[10923-16383] (5461 slots) master
S: 4792e7b336044818bf41711c542b73afa97dd1f6 172.17.34.186:6381
   replicates 4cb5e4bf468a7fd89f10499a298b51e8472644a4
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join
.......................................................................................```

Here is what cluster nodes looks like from another host in the cluster:
```127.0.0.1:6380> cluster nodes
7dd79d5a668ef9b05b79a94e4a5de7988e911b71 172.17.32.101:6381@16381 master - 0 1567315080072 4 connected
4cb5e4bf468a7fd89f10499a298b51e8472644a4 172.17.32.101:6380@16380 myself,master - 0 1567315082000 3 connected 5461-10922
c5e4afa7739ac985a7df62125efea3d5ef5cd2f8 172.17.30.175:6381@16381 master - 0 1567315082077 2 connected
4792e7b336044818bf41711c542b73afa97dd1f6 172.17.34.186:6381@16381 master - 0 1567315079071 6 connected
e17471ea78baf8b361ed89ae981aa6a2a3d67b1d 172.17.30.175:6380@16380 master - 0 1567315083080 1 connected 0-5460
97e7c990cb0de29130b396459f275ce0062fc10c 172.17.34.186:6380@16380 master - 0 1567315081074 5 connected 10923-16383```

@artix75
Copy link
Contributor

artix75 commented Sep 9, 2019

@joshgies-xad So, is it stuck on "Waiting for the cluster to join"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants