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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/qdrant/qdrant/llms.txt
Use this file to discover all available pages before exploring further.
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
Setcluster.enabled to true in your configuration:
config/config.yaml
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:
Additional Nodes
Start additional nodes with both--uri and --bootstrap flags:
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
Replication
Configure replication at the collection level to ensure data availability:Replication Parameters
| Parameter | Description | Default |
|---|---|---|
replication_factor | Number of replicas for each shard | 1 |
write_consistency_factor | Number of replicas that must acknowledge a write | 1 |
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
Consensus (Raft)
Qdrant uses the Raft consensus algorithm for:- Leader election
- Cluster membership management
- Collection metadata synchronization
- Distributed coordination
Consensus Configuration
config/config.yaml
Shard Transfer
Qdrant supports multiple shard transfer methods during rebalancing:config/config.yaml
Transfer Methods
| Method | Description | Best For |
|---|---|---|
stream_records | Stream records one by one | Small shards |
snapshot | Transfer entire snapshot | Large shards |
wal_delta | Transfer WAL changes | Recently created shards |
null | Automatic selection | General use |
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
Kubernetes StatefulSet Cluster
Deploy a distributed cluster on Kubernetes:Monitoring Cluster Health
Check cluster status via the API:- Node status and peer information
- Raft state and leader
- Consensus term information
Node Types
Qdrant supports different node types:Normal Node
Listener Node
Scaling the Cluster
Adding Nodes
- Start a new node with
--bootstrappointing to an existing node - Qdrant automatically rebalances shards to the new node
- Monitor the rebalancing progress via
/clusterendpoint
Removing Nodes
- Remove the node from the cluster via API or stop the process
- Qdrant automatically moves shards to remaining nodes
- Ensure
replication_factoris sufficient for data safety
Best Practices
Odd Number of Nodes
Odd Number of Nodes
Use an odd number of nodes (3, 5, 7) for better Raft consensus and leader election.
Replication Factor
Replication Factor
Set
replication_factor to at least 3 for production clusters to ensure high availability.Write Consistency
Write Consistency
Use
write_consistency_factor = (replication_factor / 2) + 1 for strong consistency.Network Latency
Network Latency
Keep cluster nodes in the same region or availability zone to minimize consensus latency.
Resource Allocation
Resource Allocation
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