You have a single-node Qdrant running fine for nine months. Search latency is good, the team trusts it, and the collection has grown to forty million points. Then a routine kernel patch reboots the host during a low-traffic window, the VM comes back up, and the data volume comes back read-only because the previous shutdown didn’t flush cleanly. Recovery from the last filesystem snapshot loses six hours of writes. Nobody calls this an outage, but everyone in the room knows what it would have been at a different time of day. Single-node Qdrant is fine for development and prototypes. For anything where ingestion is continuous and queries are user-facing, you want three nodes with raft consensus, replication factor 2 or 3 on production collections, and automated snapshot rotation to object storage that you actually test restoring from.
What’s happening
Qdrant clusters work on a peer-to-peer model with raft consensus for cluster topology — there is no dedicated coordinator process, every node participates in the raft log. Collections are split into shards (sharding factor decided at collection creation) and each shard can have multiple replicas across nodes (replication factor). When the application issues a query, any node can serve it; that node routes shard reads to the local copy if it has one, otherwise to a peer with the replica. Writes propagate through the replica set. The two operational properties this gives you are: (1) any single node can fail without a service outage if your collection’s replication factor is >= 2, and (2) you can grow capacity by adding nodes and asking Qdrant to move shards around. Versus single-node Qdrant, the operational shape is different in three ways — you need a TCP-aware load balancer in front (clients connect to one address, not three), you need to bootstrap the cluster correctly (one node starts a new cluster, others join an existing one), and snapshot semantics are per-shard not per-collection so your restore procedure needs to handle that. This guide covers the bootstrap.
How to verify
Cluster topology from any node:
curl -fsS -H "api-key: ${QDRANT_API_KEY}" \
https://qdrant-01.internal:6333/cluster | jq '{
status: .status,
peer_id: .result.peer_id,
raft_info: .result.raft_info,
peers: (.result.peers | to_entries | map({peer: .key, uri: .value.uri}))
}'
You want status: "ok", three peers listed, and raft_info reporting a non-zero term plus one is_voter: true per peer. Collection-level health (shard distribution):
curl -fsS -H "api-key: ${QDRANT_API_KEY}" \
https://qdrant-01.internal:6333/collections/documents/cluster | jq
For a collection with shard_number=6 and replication_factor=2, you should see 12 shard placements (6 shards x 2 replicas) distributed across the three nodes. If any shard reports state: Dead or all replicas live on the same peer, the cluster is not healthy and you need to call POST /collections/{name}/cluster to rebalance before you trust it.
Snapshot integrity from S3:
aws s3 ls s3://qdrant-snapshots-prod/documents/ --recursive | tail -5
# pick the most recent snapshot name, then:
aws s3 cp s3://qdrant-snapshots-prod/documents/<latest>.snapshot /tmp/restore-test.snapshot
file /tmp/restore-test.snapshot # should report a non-empty binary, several hundred MB+
A snapshot that’s a few kilobytes is empty — your snapshot job ran but the API returned an error you didn’t catch.
The fix
Save the script as /root/setup-qdrant-cluster-node.sh and run on each of the three nodes after editing the per-node variables. On node 1, the script bootstraps a new cluster. On nodes 2 and 3, it joins via the --bootstrap URI. The script does base hardening on Ubuntu 22.04, installs Qdrant from the official Debian package, configures TLS with mutual auth on the inter-node port (6335) and TLS on the client-facing REST/gRPC ports (6333 + 6334), wires API-key auth, sets up a snapshot-to-S3 cron job using awscli, and prevents accidental cluster split-brain by setting consensus.tick_period_ms and explicit join behavior.
#!/usr/bin/env bash
set -euo pipefail
### Ubuntu 22.04 Qdrant 1.11 cluster installer
### Run on each of the 3 nodes after editing the variables below
### Node 1: leave PEER_BOOTSTRAP_URI empty to start a new cluster
### Node 2/3: set PEER_BOOTSTRAP_URI to node 1's https://...:6335 endpoint
if [[ "$(id -u)" -ne 0 ]]; then
echo "Run as root."
exit 1
fi
# === EDIT PER NODE ===
NODE_NAME="qdrant-01" # qdrant-01 / qdrant-02 / qdrant-03
NODE_HOSTNAME="qdrant-01.internal"
NODE_IP="10.40.0.31"
PEER_IPS=("10.40.0.31" "10.40.0.32" "10.40.0.33")
PEER_BOOTSTRAP_URI="" # empty on node 1; "https://qdrant-01.internal:6335" on node 2/3
QDRANT_API_KEY="CHANGE_ME_API_KEY_LONG_RANDOM"
QDRANT_READ_ONLY_API_KEY="CHANGE_ME_READ_ONLY_KEY"
S3_BUCKET="qdrant-snapshots-prod"
S3_REGION="us-east-1"
S3_ACCESS_KEY="CHANGE_ME"
S3_SECRET_KEY="CHANGE_ME"
TLS_CERT_PATH="/etc/qdrant/tls/cert.pem"
TLS_KEY_PATH="/etc/qdrant/tls/key.pem"
TLS_CA_PATH="/etc/qdrant/tls/ca.pem"
# =====================
echo
echo "========================================"
echo "Qdrant node ${NODE_NAME} (${NODE_IP})"
echo "========================================"
echo
echo "==> Base OS update"
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y upgrade
apt-get -y install ca-certificates curl gnupg lsb-release \
ufw fail2ban unattended-upgrades chrony jq \
awscli software-properties-common
systemctl enable --now chrony
hostnamectl set-hostname "${NODE_HOSTNAME}"
echo "==> /etc/hosts for peers"
for i in "${!PEER_IPS[@]}"; do
name="qdrant-0$((i+1)).internal"
if ! grep -q "${name}" /etc/hosts; then
echo "${PEER_IPS[$i]} ${name}" >> /etc/hosts
fi
done
echo "==> SSH hardening"
sed -i 's|^[#[:space:]]*PermitRootLogin.*|PermitRootLogin prohibit-password|' /etc/ssh/sshd_config
sed -i 's|^[#[:space:]]*PasswordAuthentication.*|PasswordAuthentication no|' /etc/ssh/sshd_config
sshd -t && systemctl restart ssh
echo "==> fail2ban + unattended-upgrades"
cat > /etc/fail2ban/jail.d/sshd.local <<'FAIL2BAN'
[sshd]
enabled = true
port = ssh
backend = systemd
maxretry = 4
findtime = 10m
bantime = 1h
FAIL2BAN
systemctl enable --now fail2ban
cat > /etc/apt/apt.conf.d/52unattended-upgrades-local <<'AUTOUP'
Unattended-Upgrade::Automatic-Reboot "false";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
AUTOUP
echo "==> UFW — SSH + peer raft (6335) + client TLS (6333,6334)"
ufw --force reset
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp
for ip in "${PEER_IPS[@]}"; do
ufw allow from "${ip}" to any port 6335 proto tcp comment 'qdrant raft'
done
ufw allow 6333/tcp comment 'qdrant REST TLS'
ufw allow 6334/tcp comment 'qdrant gRPC TLS'
ufw --force enable
echo "==> Kernel tuning"
cat > /etc/sysctl.d/99-qdrant.conf <<'SYSCTL'
vm.max_map_count = 524288
vm.swappiness = 1
fs.file-max = 1048576
net.core.somaxconn = 4096
SYSCTL
sysctl --system
cat > /etc/security/limits.d/99-qdrant.conf <<'LIMITS'
qdrant soft nofile 1048576
qdrant hard nofile 1048576
LIMITS
echo "==> Qdrant package install"
curl -fsSL https://qdrant.com/install/qdrant.gpg | gpg --dearmor -o /usr/share/keyrings/qdrant.gpg
echo "deb [signed-by=/usr/share/keyrings/qdrant.gpg] https://qdrant.com/deb/ stable main" \
> /etc/apt/sources.list.d/qdrant.list
apt-get update
apt-get -y install qdrant
systemctl stop qdrant || true
echo "==> Persistent data volume — assumes /dev/sdb attached"
if [[ -b /dev/sdb && ! -d /var/lib/qdrant ]]; then
if ! blkid /dev/sdb; then
mkfs.ext4 -L qdrant /dev/sdb
fi
mkdir -p /var/lib/qdrant
echo "LABEL=qdrant /var/lib/qdrant ext4 defaults,noatime 0 2" >> /etc/fstab
mount /var/lib/qdrant
fi
mkdir -p /var/lib/qdrant/{storage,snapshots}
chown -R qdrant:qdrant /var/lib/qdrant
echo "==> TLS material check"
for p in "${TLS_CERT_PATH}" "${TLS_KEY_PATH}" "${TLS_CA_PATH}"; do
if [[ ! -s "${p}" ]]; then
echo "ERROR: missing TLS material at ${p}"
echo " Provision certs from your internal CA — cert/key for this node + CA bundle for peer verification."
exit 1
fi
done
chown -R qdrant:qdrant /etc/qdrant/tls
chmod 600 "${TLS_KEY_PATH}"
echo "==> Qdrant config"
cat > /etc/qdrant/config/production.yaml <<EOF
log_level: INFO
storage:
storage_path: /var/lib/qdrant/storage
snapshots_path: /var/lib/qdrant/snapshots
on_disk_payload: true
performance:
max_search_threads: 0
max_optimization_threads: 2
service:
host: ${NODE_IP}
http_port: 6333
grpc_port: 6334
api_key: ${QDRANT_API_KEY}
read_only_api_key: ${QDRANT_READ_ONLY_API_KEY}
enable_tls: true
tls:
cert: ${TLS_CERT_PATH}
key: ${TLS_KEY_PATH}
ca_cert: ${TLS_CA_PATH}
cert_ttl: 3600
cluster:
enabled: true
p2p:
port: 6335
enable_tls: true
consensus:
tick_period_ms: 100
bootstrap_timeout_sec: 15
EOF
chown qdrant:qdrant /etc/qdrant/config/production.yaml
chmod 600 /etc/qdrant/config/production.yaml
echo "==> systemd unit override — pass bootstrap arg"
mkdir -p /etc/systemd/system/qdrant.service.d
if [[ -n "${PEER_BOOTSTRAP_URI}" ]]; then
cat > /etc/systemd/system/qdrant.service.d/cluster.conf <<EOF
[Service]
Environment=QDRANT__CLUSTER__ENABLED=true
ExecStart=
ExecStart=/usr/bin/qdrant --config-path /etc/qdrant/config/production.yaml --bootstrap ${PEER_BOOTSTRAP_URI} --uri https://${NODE_HOSTNAME}:6335
LimitNOFILE=1048576
EOF
else
cat > /etc/systemd/system/qdrant.service.d/cluster.conf <<EOF
[Service]
Environment=QDRANT__CLUSTER__ENABLED=true
ExecStart=
ExecStart=/usr/bin/qdrant --config-path /etc/qdrant/config/production.yaml --uri https://${NODE_HOSTNAME}:6335
LimitNOFILE=1048576
EOF
fi
systemctl daemon-reload
systemctl enable --now qdrant
echo "==> Wait for Qdrant"
for i in {1..90}; do
if curl -fsSk -H "api-key: ${QDRANT_API_KEY}" "https://127.0.0.1:6333/healthz" >/dev/null 2>&1; then
break
fi
sleep 2
done
echo "==> Snapshot-to-S3 cron + helper"
cat > /usr/local/bin/qdrant-snapshot-to-s3.sh <<EOF
#!/usr/bin/env bash
set -euo pipefail
export AWS_ACCESS_KEY_ID=${S3_ACCESS_KEY}
export AWS_SECRET_ACCESS_KEY=${S3_SECRET_KEY}
export AWS_DEFAULT_REGION=${S3_REGION}
API_KEY="${QDRANT_API_KEY}"
ENDPOINT="https://127.0.0.1:6333"
BUCKET="s3://${S3_BUCKET}"
# Snapshot each collection
collections=\$(curl -fsSk -H "api-key: \${API_KEY}" "\${ENDPOINT}/collections" | jq -r '.result.collections[].name')
for c in \${collections}; do
echo "Snapshotting \${c}"
snap=\$(curl -fsSk -X POST -H "api-key: \${API_KEY}" \
"\${ENDPOINT}/collections/\${c}/snapshots" | jq -r '.result.name')
curl -fsSk -H "api-key: \${API_KEY}" \
"\${ENDPOINT}/collections/\${c}/snapshots/\${snap}" \
-o "/var/lib/qdrant/snapshots/\${c}-\${snap}"
aws s3 cp --no-progress "/var/lib/qdrant/snapshots/\${c}-\${snap}" \
"\${BUCKET}/\${c}/\${snap}"
rm -f "/var/lib/qdrant/snapshots/\${c}-\${snap}"
done
# Trim local snapshot list to last 3 per collection
for c in \${collections}; do
curl -fsSk -H "api-key: \${API_KEY}" "\${ENDPOINT}/collections/\${c}/snapshots" \
| jq -r '.result | sort_by(.creation_time) | .[:-3] | .[].name' \
| while read -r name; do
[[ -z "\${name}" ]] && continue
curl -fsSk -X DELETE -H "api-key: \${API_KEY}" \
"\${ENDPOINT}/collections/\${c}/snapshots/\${name}" || true
done
done
# S3 lifecycle rule is the right tool for long-term retention; this script only
# ensures the local snapshots list stays bounded.
EOF
chmod 700 /usr/local/bin/qdrant-snapshot-to-s3.sh
# Run on a single peer to avoid 3x duplicate uploads — pick node 1.
if [[ "${NODE_NAME}" == "qdrant-01" ]]; then
cat > /etc/cron.d/qdrant-snapshots <<'CRON'
# m h dom mon dow user command
15 3 * * * root /usr/local/bin/qdrant-snapshot-to-s3.sh >> /var/log/qdrant-snapshot.log 2>&1
CRON
fi
echo
echo "========================================"
echo "DONE"
echo "========================================"
echo
echo "Listeners:"
ss -lntp | grep -E ':(6333|6334|6335)\b' || true
echo
echo "Cluster:"
curl -fsSk -H "api-key: ${QDRANT_API_KEY}" \
https://127.0.0.1:6333/cluster | jq '.result | {peer_id, raft_info, peer_count: (.peers|length)}' || true
echo
echo "Next steps:"
echo " 1. On node 2/3, run with PEER_BOOTSTRAP_URI=https://${NODE_HOSTNAME}:6335"
echo " 2. After all 3 nodes are up, create collections with shard_number=6 replication_factor=2"
Make it executable and run:
chmod 700 /root/setup-qdrant-cluster-node.sh
/root/setup-qdrant-cluster-node.sh
When all three nodes report up in /cluster, create production collections with explicit replication. Don’t use replication_factor 1 in production — that’s a single-node collection wearing cluster makeup.
curl -fsSk -X PUT -H "api-key: ${QDRANT_API_KEY}" \
https://qdrant-01.internal:6333/collections/documents \
-H 'Content-Type: application/json' \
-d '{
"vectors": {"size": 1536, "distance": "Cosine"},
"shard_number": 6,
"replication_factor": 2,
"write_consistency_factor": 1,
"on_disk_payload": true,
"hnsw_config": {"m": 16, "ef_construct": 256}
}'
Put a TCP load balancer in front (HAProxy, your cloud NLB, anything that does TCP-level health probes — Qdrant’s REST/gRPC live on the same ports, and you want the LB to forward both). Health check GET /healthz over TLS, fail a node out within 10 seconds of it stopping responding. Confirm restore works: take a snapshot from production, ship it to a sandbox cluster, restore via PUT /collections/{name}/snapshots/upload or recover, query, compare counts. Schedule that restore drill quarterly — backups that haven’t been validated are just hopes.
Stack Harbor operates Qdrant clusters under environment management with raft quorum, shard placement skew, and snapshot age alerting in our monitoring plane. If you’d rather not write the runbook for “shard X has replicas only on node Y”, start a scoping call.