Nodes you add start empty, and your data stays on the existing nodes until you spread it. Create a new collection, replicate existing shards, or move existing shards to spread your data across all nodes.
Before you begin
Section titled “Before you begin”You need scaled up a
Running database, and have its endpoint and API key from
Connect to a vector database. The commands
below are Qdrant API calls. <your-endpoint-url> is the Endpoint URL, <your-api-key> is your
API key, and <collection_name> is a collection in the database.
Choose the option that fits what you need.
| Option | Use it when |
|---|---|
| Create a new collection | New data should spread across all nodes by its shard number and replication factor. |
| Replicate existing shards | You want a copy of a shard on the new node for redundancy. |
| Move existing shards | You want to relocate a shard to the new node rather than copy it. |
Create a new collection
Section titled “Create a new collection”Set the shard number to a multiple of your node count for an even spread.
curl -X PUT \ -H "api-key: <your-api-key>" \ -d '{ "vectors": { "size": 300, "distance": "Cosine" }, "shard_number": 8, "replication_factor": 3 }' \ https://<your-endpoint-url>:6333/collections/<collection_name>Replicate an existing shard
Section titled “Replicate an existing shard”Get the collection’s cluster information to find the peer IDs and which shards sit on each:
curl -X GET \ -H "api-key: <your-api-key>" \ https://<your-endpoint-url>:6333/collections/<collection_name>/clusterReplicate a shard to the new node. In the call below, the first peer ID is the node that holds the shard now. The second is the new node. Both come from that output.
curl -X PUT \ -H "api-key: <your-api-key>" \ -d '{ "replicate_shard": { "shard_id": 0, "from_peer_id": 123, "to_peer_id": 456 } }' \ https://<your-endpoint-url>:6333/collections/<collection_name>/clusterTo remove a copy from a node later, drop the replica:
curl -X POST \ -H "api-key: <your-api-key>" \ -d '{ "drop_replica": { "shard_id": 0, "peer_id": 123 } }' \ https://<your-endpoint-url>:6333/collections/<collection_name>/clusterMove a shard
Section titled “Move a shard”Moving a shard relocates it rather than copying it.
curl -X POST \ -H "api-key: <your-api-key>" \ -d '{ "move_shard": { "shard_id": 0, "from_peer_id": 123, "to_peer_id": 456 } }' \ https://<your-endpoint-url>:6333/collections/<collection_name>/clusterA move streams the shard’s records to the new node in batches by default. To transfer the shard with
its index and quantized data as a snapshot instead, add a method entry set to snapshot to the
JSON you send:
"move_shard": { "shard_id": 0, "from_peer_id": 123, "to_peer_id": 456, "method": "snapshot" }Check the result
Section titled “Check the result”Run the cluster information call again. The shard now lists the new node’s peer ID. The Total cluster peers count on the Overview tab shows the number of nodes in the cluster. To watch the cluster after a change, check Total pending operations on the Service graphs; see Monitor a vector database.
What to do next
Section titled “What to do next”Take a snapshot before a bulk change. For help, see Troubleshooting Vector Database.