pshima / consul-snapshot

consul-snapshot is a backup and restore utility for Consul (https://www.consul.io). This is slightly different than some other utilities out there as this runs as a daemon for backups and ships them to S3. Also has integrated monitoring and backup health checks.
Apache License 2.0
116 stars 35 forks source link

backup/restore to local disk #15

Closed richard-mauri closed 7 years ago

richard-mauri commented 8 years ago

I need a backup/restore for Consul and storing in a public cloud like AWS/S3 won't work for us. We manage our own datacenter and I'd like to instead backup/restore to/from local drive/nfs.

I see there is support in the source code for first backing up locally before uploading, but local is not exposed as a first class final data source.

Also, the env variables for all the remote information is in the way.

I also see there is an "acceptance" flag that when set bypasses the remote behavior.

And lastly, I see an outstanding PR supporting Google cloud that has some improvements to better enable conditional logic for handling S3 vs GC.

Before I try hacking this in, I thought I'd post inquiring about how best to go about this. I wish the GC support was merged so I could leverage some of the improvements, but that merge sems somewhat stalled.

I'm sure others would like a first class -local option.

Thanks

EDIT: I hacked the config.go,backup.go and restore.go to support local backups. I'm testing it now, but I'll issue a PR if it looks like a go.

pshima commented 8 years ago

hi @richard-mauri I would support local backups as long as it fits into the regular flow. I haven't had google cloud access to test out the PR which is the hang up there. I'll take another look at getting that going.

richard-mauri commented 7 years ago

I have forked your project and it might be worth having a PR with that local feature before the google cloud storage PR? See: https://github.com/richard-mauri/consul-snapshot

pshima commented 7 years ago

Hi @richard-mauri PRs welcome for local file backups, but this is already supported directly in consul so it would probably be better to just use the native functionality: https://www.consul.io/docs/commands/snapshot.html