consul icon indicating copy to clipboard operation
consul copied to clipboard

Consul Remote Backup and Restore

Open johnakash opened this issue 8 years ago • 5 comments

Description of the Issue (and unexpected/desired result)

Consul remote backup and restore not working.

Reproduction steps

We have configured a single node server and configured some key values on the same.

I have followed the API snapshot provided in the document (https://www.consul.io/api/snapshot.html) and got snapshots using the same

snapshot command used curl http://192.168.0.11:8500/v1/snapshot?dc=west-aws-dev-ccp -o snapshot.tgz

snapshot file size du -sh * 496K snapshot.tgz

Extracted file size du -sh * 4.0K SHA256SUMS 4.0K meta.json 496K snapshot.tgz 1.9M state.bin

Restore command used curl --request PUT --data-binary snapshot.tgz http://192.168.0.13:8500/v1/snapshot

Command Output: failed to decompress snapshot: gzip: invalid header

Error in consul log, 2018/04/18 23:47:47 [ERR] http: Request PUT /v1/snapshot, error: failed to decompress snapshot: gzip: invalid header from=192.168.0.13:57310

Could you please let us know how can we fix this issue?

consul version for both Client and Server

Client: v0.8.5 Server: v0.8.5

Client & Server:

Single node server

Operating system and Environment details

RHEL 7.4

johnakash avatar Apr 19 '18 04:04 johnakash

From the doc link, during the PUT, should there be an ~~ampersand~~~ at "@" before the filename?

shantanugadgil avatar Apr 19 '18 16:04 shantanugadgil

Awesome it worked well.

Is there anyway to select any particular KV on snapshot backup? As of now this will back up all the data available on the consul cluster and I would like to backup particular KV only.

johnakash avatar Apr 19 '18 21:04 johnakash

@shantanugadgil , Could you please provide an update on this? "Is there anyway to select any particular KV on snapshot backup? "

johnakash avatar Apr 24 '18 09:04 johnakash

@johnakash I don't know. I don't know if Consul even has such a feature.

BTW, I think for general questions, it would be better to use the Consul Google Group rather than create github issues.

Regards, Shantanu

EDIT: This does indeed seemed to be cross-posted on the group as well as here. :|

shantanugadgil avatar Apr 24 '18 11:04 shantanugadgil

Agree this is better suited for the mailing list.

Is there anyway to select any particular KV on snapshot backup? As of now this will back up all the data available on the consul cluster and I would like to backup particular KV only.

Not at this time, no. You can use KV APIs to achieve specific migrations or backup/restore operations against paths.

pearkes avatar Jul 24 '18 22:07 pearkes