Skip to content

Commit ec28983

Browse files
committed
update documentation
1 parent ff81b0e commit ec28983

7 files changed

Lines changed: 73 additions & 16 deletions

File tree

UPGRADE-OPERATIONS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,8 @@ export QDRANT_S3_ACCESS_KEY_ID="your-access-key"
750750
export QDRANT_S3_SECRET_ACCESS_KEY="your-secret-key"
751751
export QDRANT_S3_BUCKET_NAME="qdrant-snapshots"
752752

753-
# Auto-discover peers
754-
export GET_PEERS_FROM_CLUSTER_INFO="true"
753+
# Disable Auto-discover of peers
754+
export GET_PEERS_FROM_CLUSTER_INFO="false"
755755

756756
# Timeout settings
757757
export CURL_TIMEOUT="1800"

qdrant-backup-restore/k8s/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ kubectl -n <namespace> logs -lapp=qdrant-backup -f
163163
Update the following environment varibles accordingly;
164164

165165
1. Update the `secretKeyRef.name` on all `env:` entries under `env.[*].valueFrom` to the name of the kubernetes secrets deployed when configuring Qdrant.
166-
2. Update the `QDRANT_SOURCE_HOSTS` to the kubernetes service domain of the source Qdrant deployment.
166+
2. Update the `QDRANT_SOURCE_HOSTS` to empty `""`.
167167
3. Update the `QDRANT_RESTORE_HOSTS` to the target qdrant cluster service domain.
168-
4. `GET_PEERS_FROM_CLUSTER_INFO` should be `true` to discover qdrant cluster peers when backing up collections.
168+
4. `GET_PEERS_FROM_CLUSTER_INFO` should be `false` during restore.
169169
5. `CURL_TIMEOUT` is set at `3000` seconds. This is the max time curl will wait for request to complete. Its increased in scenarios where restoration takes a while.
170170
6. `QDRANT_S3_LINK_EXPIRY_DURATION` is set at `3600`. This is the duration that an s3 presigned url will be active. The url is used during the recovery process.
171171
7. `QDRANT_WAIT_ON_TASK` is set as `true`. This configuation make restoration process synchronous meaning 'wait for snapshot process to finish successfully before moving on'. Its used during backup and recovery.

qdrant-backup-restore/k8s/backup-job.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,30 @@ spec:
2626
- -c
2727
- "cd scripts && ./qdrant_backup_recovery.sh create_snap"
2828
env:
29+
- name: QDRANT_S3_ACCESS_KEY_ID
30+
valueFrom:
31+
secretKeyRef:
32+
name: qdrant-credentials-minio # change this to your qdrant kubernetes secret name
33+
key: QDRANT_S3_ACCESS_KEY_ID
34+
- name: QDRANT_S3_SECRET_ACCESS_KEY
35+
valueFrom:
36+
secretKeyRef:
37+
name: qdrant-credentials-minio # change this to your qdrant kubernetes secret name
38+
key: QDRANT_S3_SECRET_ACCESS_KEY
39+
- name: QDRANT_S3_BUCKET_NAME
40+
valueFrom:
41+
secretKeyRef:
42+
name: qdrant-credentials-minio # change this to your qdrant kubernetes secret name
43+
key: QDRANT_S3_BUCKET_NAME
2944
- name: QDRANT_API_KEY
3045
valueFrom:
3146
secretKeyRef:
3247
name: qdrant-credentials-minio # change this to your qdrant kubernetes secret name
3348
key: QDRANT_API_KEY
49+
- name: QDRANT_S3_ENDPOINT_URL
50+
value: "http://minio.default.svc.cluster.local:9000" # change this to your s3 endpoint url
51+
- name: MC_CONFIG_DIR
52+
value: "mc" # sets the configuration location for mc S3 client
3453
- name: QDRANT_SOURCE_HOSTS
3554
value: "http://qdrant-headless:6333" # change this to your qdrant kubernetes headless service name
3655
- name: QDRANT_RESTORE_HOSTS
@@ -39,6 +58,8 @@ spec:
3958
value: "true"
4059
- name: CURL_TIMEOUT
4160
value: "3000" # increase if more time is needed for a single backup
61+
- name: BACKUP_COLLECTION_ALIASES_ON_S3
62+
value: "true"
4263
resources:
4364
requests:
4465
cpu: "100m"

qdrant-backup-restore/k8s/configmap-snapshot.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ metadata:
66
app: qdrant-snapshots-file
77
component: script
88
data:
9+
# this is used to provide a list of snapshots to restore
910
snapshots: |
1011
,_default_256,_default_256-5528114518172461-2026-01-29-11-44-26.snapshot
1112
,midlib,midlib-567156434043892-2026-01-29-11-44-27.snapshot
13+
14+
# this is used to provide a list of collections to restore
15+
collections: |
16+
,_default_256
17+
,Assistant_SapSenMarkdownHeaderMetadataSectionClean_Assistant-Hybrid-Index-1024-SAP-SEN

qdrant-backup-restore/k8s/restore-job.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,21 @@ spec:
4747
name: qdrant-credentials-minio
4848
key: QDRANT_API_KEY
4949
- name: QDRANT_SOURCE_HOSTS
50-
value: "http://qdrant-headless:6333" # change this to your source qdrant kubernetes headless service name
50+
value: "" # leave empty if source host is not available
5151
- name: QDRANT_S3_ENDPOINT_URL
5252
value: "http://minio.default.svc.cluster.local:9000" # change this to your s3 endpoint url
5353
- name: QDRANT_RESTORE_HOSTS
54-
value: "http://qdrantr2-headless:6333" # change this to your target qdrant kubernetes headless service name
54+
value: "http://qdrant-headless:6333" # change this to your target qdrant kubernetes headless service name
5555
- name: GET_PEERS_FROM_CLUSTER_INFO
56-
value: "true"
56+
value: "false"
5757
- name: QDRANT_SNAPSHOT_DATETIME_FILTER
58-
value: "" # change tis to filter snapshts based on date (glob matching is used)
58+
value: "" # set this to filter snapshots based on date (glob matching is used) e.g "2026-01-29" = all snapshots in 29th January 2026, "2026-01" = all snapshots in January 2026.
5959
- name: CURL_TIMEOUT
6060
value: "3000" # increase if more time is needed for a single restore
6161
- name: MC_CONFIG_DIR
6262
value: "mc" # sets the configuration location for mc S3 client
63+
- name: BACKUP_COLLECTION_ALIASES_ON_S3
64+
value: "true"
6365
resources:
6466
requests:
6567
cpu: "100m"

qdrant-backup-restore/k8s/restore-specific-snapshot-job.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,21 @@ spec:
4747
name: qdrant-credentials-minio
4848
key: QDRANT_API_KEY
4949
- name: QDRANT_SOURCE_HOSTS
50-
value: "http://qdrant-headless:6333" # change this to your source qdrant kubernetes headless service name
50+
value: "" # leave empty if source host is not available
5151
- name: QDRANT_S3_ENDPOINT_URL
5252
value: "http://minio.default.svc.cluster.local:9000" # change this to your s3 endpoint url
5353
- name: QDRANT_RESTORE_HOSTS
54-
value: "http://qdrantr2-headless:6333" # change this to your target qdrant kubernetes headless service name
54+
value: "http://qdrant-headless:6333" # change this to your target qdrant kubernetes headless service name
5555
- name: GET_PEERS_FROM_CLUSTER_INFO
56-
value: "true"
56+
value: "false"
5757
- name: CURL_TIMEOUT
5858
value: "3000" # increase if more time is needed for a single restore
5959
- name: QDRANT_SNAPSHOT_DATETIME_FILTER
6060
value: "" # change tis to filter snapshts based on date (glob matching is used)
6161
- name: MC_CONFIG_DIR
6262
value: "mc" # sets the configuration location for mc S3 client
63+
- name: BACKUP_COLLECTION_ALIASES_ON_S3
64+
value: "true"
6365
resources:
6466
requests:
6567
cpu: "100m"
@@ -71,7 +73,12 @@ spec:
7173
- name: qdrant-backup-restore-script
7274
mountPath: /scripts/qdrant_backup_recovery.sh
7375
subPath: qdrant_backup_recovery.sh
76+
# this is used to restore specific collections
7477
- name: qdrant-snapshots-file
78+
mountPath: /scripts/collections
79+
subPath: collections
80+
# this is used to restore specific snapshots
81+
- name: qdrant-collections-file
7582
mountPath: /scripts/snapshots
7683
subPath: snapshots
7784
- name: scripts

qdrant-backup-restore/qdrant_backup_recovery.sh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ get_collections() {
7474
fi
7575
_printf "fetching collections!\n"
7676

77-
local host="${source_hosts[0]}"
77+
local host="${source_hosts[0]:-}"
78+
if [[ -z "$host" ]]; then
79+
_printf "source host is not available for fetching collections. Please ensure QDRANT_SOURCE_HOSTS is set correctly in your environment variables.\n"
80+
exit 1
81+
fi
7882

7983
collections_count=0
8084

@@ -132,7 +136,11 @@ create_snapshot_from_peer() {
132136

133137
# creates and appends created collection snapshot from a qdrant node to $QDRANT_SNAPSHOTS_FILE
134138
track_created_collection_snapshot() {
135-
local host="${source_hosts[0]}"
139+
local host="${source_hosts[0]:-}"
140+
if [[ -z "$host" ]]; then
141+
_printf "source host is not available for fetching collection snapshots. Please ensure QDRANT_SOURCE_HOSTS is set correctly in your environment variables.\n"
142+
exit 1
143+
fi
136144
local collection_name="$1"
137145
local result=""
138146
local status=""
@@ -537,7 +545,11 @@ recover_collection_snapshots(){
537545

538546
# gets the collection aliases from a qdrant node and appends it to $QDRANT_COLLECTION_ALIASES file
539547
get_collection_aliases() {
540-
local host="${source_hosts[0]}"
548+
local host="${source_hosts[0]:-}"
549+
if [[ -z "$host" ]]; then
550+
_printf "source host is not available for fetching collection aliases. Please ensure QDRANT_SOURCE_HOSTS is set correctly in your environment variables.\n"
551+
exit 1
552+
fi
541553
local result=""
542554
local status=""
543555

@@ -638,7 +650,11 @@ recover_collection_alias() {
638650
# restores collection aliases to a qdrant node and appends progress to $QDRANT_ALIAS_RECOVERY_HISTORY_FILE
639651
recover_collection_aliases() {
640652

641-
local host="${restore_hosts[0]}"
653+
local host="${restore_hosts[0]:-}"
654+
if [[ -z "$host" ]]; then
655+
_printf "restore host is not available for recovering collection aliases. Please ensure QDRANT_RESTORE_HOSTS is set correctly in your environment variables.\n"
656+
exit 1
657+
fi
642658

643659

644660
if [ "$BACKUP_COLLECTION_ALIASES_ON_S3" = "true" ]; then
@@ -708,7 +724,12 @@ delete_files() {
708724

709725
# gets qdrant peer host url using cluster info endpoint. Sets the port to $QDRANT_HTTP_PORT the http port.
710726
get_peers_from_cluster_info() {
711-
local host="${source_hosts[0]}"
727+
local host="${source_hosts[0]:-}"
728+
if [[ -z "$host" ]]; then
729+
_printf "source host is not available. Please ensure QDRANT_SOURCE_HOSTS is set correctly in your environment variables. If restoring snapshots set QDRANT_SOURCE_HOSTS and GET_PEERS_FROM_CLUSTER_INFO to empty string.\n"
730+
exit 1
731+
fi
732+
712733
result=$(_curl GET "$host/cluster" --header "api-key: $QDRANT_API_KEY")
713734
entries=$(jq -r '.result.peers // {}' <<< "$result")
714735
peer_uri_entries=$(jq -r 'to_entries[] | "\(.key) \(.value.uri)"' <<< "$entries")

0 commit comments

Comments
 (0)