in victoria cluster, does I need to run vmbackup command in one of vmstorage pod

174 views
Skip to first unread message

Sutthiphong Suwanich

unread,
May 3, 2023, 2:55:07 PM5/3/23
to victorametrics-users
Dear all,

   I would like to test command vmbackup using my notebook as step below but I got error

#kubectl port-forward svc/victoria-metrics-victoria-metrics-cluster-vmstorage -n victoria 8482:8482

#vmbackup-prod -snapshot.createURL=http://localhost:8482/snapshot/create -storageDataPath=/storage -dst=fs:///tmp

fatal VictoriaMetrics/app/vmbackup/main.go:104 cannot create backup: cannot open snapshot at "/storage/snapshots/20230503183329-1756E577E511C2F3": open /storage/snapshots/20230503183329-1756E577E511C2F3: no such file or directory

/storage is mounted from pvc with ReadWriteOnce mode. I cannot mount this pvc to other pods.

Does i need to run vmbackup command inside vmstorage pod?

if yes,

I run vmstorage as statefulsets with 2 replicas . Which one has all metrics if I run vminsert with default setting (default setting for vminsert uses -replicationFactor=1. I check it from https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#replication-and-data-safety)?


thank in advance

jun

hage...@gmail.com

unread,
May 4, 2023, 3:12:17 AM5/4/23
to victorametrics-users
> Does i need to run vmbackup command inside vmstorage pod?

Yes. vmbackup works with local filesystem - it needs access to `/storage` path to create a snapshot there. 
Usually, vmbackup, vmrestore or vmbackupmanager are deployed as sidecars for vmstorage pods.

> I run vmstorage as statefulsets with 2 replicas . Which one has all metrics if I run vminsert with default setting (default setting for vminsert uses -replicationFactor=1. I check it from https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#replication-and-data-safety)?

If vminsert has all two vmstorages listed in its `storageNode` command-line flag and replicationFactor=1, then none of them has full data. Each storage would contain 50% of data, since vminsert shards timeseries across available storage nodes.

Sutthiphong Suwanich

unread,
May 5, 2023, 3:39:56 AM5/5/23
to victorametrics-users
Thankyou so much

jun
Reply all
Reply to author
Forward
0 new messages