Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating backups using the single helm chart #50

Open
WyriHaximus opened this issue Jul 18, 2020 · 11 comments
Open

Creating backups using the single helm chart #50

WyriHaximus opened this issue Jul 18, 2020 · 11 comments
Labels
question Further information is requested

Comments

@WyriHaximus
Copy link

Been using victoriametrics for a few months now and it's absolutely a breeze to set up with these helm charts. But what I'm missing here is a way to back up to a network drive (cifs/smb in my case). Now I'd gladly add this to the helm chart with a cronjob. But up on researching this I found that the only way it seems to backup is using direct access to the data dir. Is there a way to backup metrics over TCP/UDP from another pod?

@valyala
Copy link
Contributor

valyala commented Jul 20, 2020

As I know, the vmbackup ma run as a sidecar in the same pod as single-node VictoriaMetrics or vmstorage component in cluster version. cc'ing @tenmozes for more input

@tenmozes
Copy link
Collaborator

actually vmbackup is a cli command which can not be executed like sidecar, need to demonize it and add scheduling
this is main reason why it doesn't exist in helm chart

@WyriHaximus
Copy link
Author

actually vmbackup is a cli command which can not be executed like sidecar, need to demonize it and add scheduling
this is main reason why it doesn't exist in helm chart

Yeah this is why I was thinking about using a cronjob for it. But if it only works with file access to the data that is going to be a bit harder

@immerrr
Copy link

immerrr commented Feb 11, 2021

I think it should be possible, I am currently working on patching the helm chart to add a sidecar container to the server pod that would run vmbackup instance managed by crond.

Looks like vmbackup image is based off alpine, and according to

https://gist.github.com/AntonFriberg/692eb1a95d61aa001dbb4ab5ce00d291

I only need to put an incremental vmbackup invocation into /etc/periodic/hourly that would invoke a snapshot-creating request via curl against localhost (btw, would be a bit less moving pieces if vmbackup would be able to send the "create snapshot" request itself), and then put that snapshot into the /latest directory. And then a daily invocation of vmbackup would copy the /latest directory a daily snapshot, that script would go into /etc/periodic/daily.

@ulikl
Copy link
Contributor

ulikl commented Feb 11, 2021

Regarding "btw, would be a bit less moving pieces if vmbackup would be able to send the "create snapshot" request itself":
vmbackup has the option "-snapshot.createURL string" to do exactly this.

@immerrr
Copy link

immerrr commented Feb 11, 2021

@ulikl ah, thank you, good to know!

does it mean that when i pass a -snapshotName=<local-snapshot> to vmbackup with -snapshot.createURL, it will create a snapshot automatically?

@WyriHaximus
Copy link
Author

So does this mean we wouldn't have to go with the sidecar route and could go with a pod (cronjob) instead? Is -snapshot.createURL the URL of VM?

@immerrr
Copy link

immerrr commented Feb 11, 2021

I think you still need a sidecar to access the volume where snapshots are created.

@WyriHaximus
Copy link
Author

WyriHaximus commented Feb 11, 2021

Ok wait, then how should I read:

 -snapshot.createURL string
    	VictoriaMetrics create snapshot url. When this is given a snapshot will automatically be created during backup. Example: http://victoriametrics:8428/snaphsot/create

(From: https://victoriametrics.github.io/vmbackup.html )

I might be missing some VM knowledge how snapshots work here tbh :D

@immerrr
Copy link

immerrr commented Feb 11, 2021

This is the URL on the VictoriaMetrics (vmstorage) instance itself, that would trigger a creation of a snapshot in its corresponding data directory. If vmbackup has access to that directory, it can then send the generated file wherever you point it (S3, GCP, etc).

@WyriHaximus
Copy link
Author

Ahhhh ok check 👍 . Yeah then it's going to be really hard not using a sidecar

@hagen1778 hagen1778 added the question Further information is requested label Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants