{
  "schema_version": 2,
  "id": "commands/cluster-addslots",
  "title": "CLUSTER ADDSLOTS",
  "url": "https://redis.io/docs/latest/commands/cluster-addslots/",
  "summary": "Assigns new hash slots to a node.",
  "since": "3.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-06-15T06:26:34-07:00",
  "page_type": "content",
  "content_hash": "dcd5095c44a104d7ac2831c01db1ad15d0505149eead1030807654990383aeff",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "This command is useful in order to modify a node's view of the cluster\nconfiguration. Specifically it assigns a set of hash slots to the node\nreceiving the command. If the command is successful, the node will map\nthe specified hash slots to itself, and will start broadcasting the new\nconfiguration.\n\nHowever note that:\n\n1. The command only works if all the specified slots are, from the point of view of the node receiving the command, currently not assigned. A node will refuse to take ownership for slots that already belong to some other node (including itself).\n2. The command fails if the same slot is specified multiple times.\n3. If one of the specified slots is marked as `importing`, Redis clears that temporary state after the node assigns the previously unbound slot to itself. At that point, the slot belongs to the node, so it is no longer being imported."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>slot [slot ...]</code></summary>\n\nOne or more hash slots to assign to the current node.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "The following command assigns slots 1, 2, and 3 to the node receiving\nthe command:\n\n    > CLUSTER ADDSLOTS 1 2 3\n    OK\n\nIf you try to execute the same command again on the same node, Redis will return an error because the slots\nare already assigned:\n\n    > CLUSTER ADDSLOTS 1 2 3\n    ERR Slot 1 is already busy"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "usage-in-redis-cluster",
      "title": "Usage in Redis Cluster",
      "role": "syntax",
      "text": "This command only works in cluster mode and is useful in the following\nRedis Cluster operations:\n\n1. To create a new `cluster ADDSLOTS` is used in order to initially setup master nodes splitting the available hash slots among them.\n2. In order to fix a broken cluster where certain slots are unassigned."
    },
    {
      "id": "information-about-slots-propagation-and-warnings",
      "title": "Information about slots propagation and warnings",
      "role": "content",
      "text": "Note that once a node assigns a set of slots to itself, it will start\npropagating this information in heartbeat packet headers. However the\nother nodes will accept the information only if they have the slot as\nnot already bound with another node, or if the configuration epoch of the\nnode advertising the new hash slot, is greater than the node currently listed\nin the table.\n\nThis means that this command should be used with care only by applications\norchestrating Redis Cluster, like `redis-cli`, and the command if used\nout of the right context can leave the cluster in a wrong state or cause\ndata loss."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` if the command was successful. Otherwise an error is returned.\n\n**RESP3:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` if the command was successful. Otherwise an error is returned."
    }
  ],
  "examples": []
}
