Skip to main content
Qdrant supports distributed deployment for horizontal scalability, high availability, and fault tolerance. A distributed cluster uses Raft consensus for coordination and supports automatic sharding and replication.

Overview

A Qdrant cluster consists of multiple nodes that:
  • Share the load across multiple machines
  • Automatically replicate data for fault tolerance
  • Use Raft consensus algorithm for distributed coordination
  • Support dynamic scaling and rebalancing

Enabling Cluster Mode

Set cluster.enabled to true in your configuration:
config/config.yaml
Or use environment variables:

Bootstrapping a Cluster

When starting a cluster, nodes must be bootstrapped using the --uri and --bootstrap flags.

First Node (Bootstrap Node)

Start the first node with only the --uri flag:
With Docker:

Additional Nodes

Start additional nodes with both --uri and --bootstrap flags:
With Docker:
The --uri flag specifies this node’s P2P address. The --bootstrap flag points to an existing cluster member.

Docker Compose Cluster

Here’s a complete 3-node cluster configuration:
docker-compose.yml
Start the cluster:

Replication

Configure replication at the collection level to ensure data availability:

Replication Parameters

write_consistency_factor must be less than or equal to replication_factor. A higher value provides stronger consistency but may impact write latency.

Default Replication

Set default replication for all new collections:
config/config.yaml

Sharding

Qdrant automatically distributes data across cluster nodes using shards. Configure sharding when creating a collection:

Shard Distribution

  • Shards are distributed evenly across available nodes
  • Each shard can have multiple replicas based on replication_factor
  • More shards enable better parallelization but add overhead

Shard Number Recommendations

A good starting point is shard_number = nodes * 2 to allow for future scaling.

Consensus (Raft)

Qdrant uses the Raft consensus algorithm for:
  • Leader election
  • Cluster membership management
  • Collection metadata synchronization
  • Distributed coordination

Consensus Configuration

config/config.yaml
Do not change tick_period_ms unless you understand the implications. Lower values increase network overhead; higher values slow down failure detection.

Shard Transfer

Qdrant supports multiple shard transfer methods during rebalancing:
config/config.yaml

Transfer Methods

Performance Tuning

Update Rate Limiting

Prevent overwhelming the cluster with concurrent updates:
config/config.yaml

Message Queue Size

For high-throughput clusters:

TLS for Inter-Node Communication

Enable TLS between cluster nodes:
config/config.yaml
All nodes in the cluster must have TLS enabled or disabled consistently. Mixed configurations are not supported.

Kubernetes StatefulSet Cluster

Deploy a distributed cluster on Kubernetes:

Monitoring Cluster Health

Check cluster status via the API:
Response includes:
  • Node status and peer information
  • Raft state and leader
  • Consensus term information

Node Types

Qdrant supports different node types:

Normal Node

Receives all updates and answers all queries.

Listener Node

Receives all updates but does not answer search/read queries. Useful for dedicated backup nodes.

Scaling the Cluster

Adding Nodes

  1. Start a new node with --bootstrap pointing to an existing node
  2. Qdrant automatically rebalances shards to the new node
  3. Monitor the rebalancing progress via /cluster endpoint

Removing Nodes

  1. Remove the node from the cluster via API or stop the process
  2. Qdrant automatically moves shards to remaining nodes
  3. Ensure replication_factor is sufficient for data safety
Always maintain at least replication_factor nodes in your cluster to avoid data loss.

Best Practices

Use an odd number of nodes (3, 5, 7) for better Raft consensus and leader election.
Set replication_factor to at least 3 for production clusters to ensure high availability.
Use write_consistency_factor = (replication_factor / 2) + 1 for strong consistency.
Keep cluster nodes in the same region or availability zone to minimize consensus latency.
Ensure all nodes have similar resources (CPU, memory, disk) for balanced performance.

Next Steps

Configuration

Fine-tune cluster performance

Security

Secure inter-node communication

Kubernetes

Deploy on Kubernetes

Docker

Docker deployment basics