Cluster Manager (redis-cli): new "backup" command#5888
Merged
antirez merged 3 commits intoredis:unstablefrom Mar 1, 2019
Merged
Cluster Manager (redis-cli): new "backup" command#5888antirez merged 3 commits intoredis:unstablefrom
antirez merged 3 commits intoredis:unstablefrom
Conversation
- Prevent cluster backup if cluster has issues and needs to be fixed. This behaviour can be overridden by adding the option '--cluster-ignore-issues'
Always save the backup, even if there are problems in the cluster. Just display a warn message and save "cluster_errors" property inside the json.
Contributor
|
Thanks again @artix75! |
JackieXie168
pushed a commit
to JackieXie168/redis
that referenced
this pull request
Apr 10, 2019
Cluster Manager (redis-cli): new "backup" command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the new "backup" command to redis-cli's cluster manager.
As its name suggests, it basically saves a backup of the cluster to a local directory.
The backup can be launched with:
redis-cli --cluster backup NODE_IP:NODE_PORT BACKUP_DIRECTORYwhere NODE_IP:NODE_PORT is the entry point address of the cluster (as usual).
ie.
redis-cli --cluster backup 127.0.0.1:7000 /tmp/mycluster_backupThe backup will consist of:
The nodes.json file will contain something like this:
The command will perform an preliminary check on the cluster. If the cluster has some problem,
the backup will be saved anyway, but it will display a warning message and the number of errors found will be saved inside every node in nodes.json (ie.
"cluster_errors": 2).In the next days I'll add more info to nodes.json (ie. migrating/importing slots), and in the near future I'll also implement a "restore" command. Anyway, at the moment, the backup can be manually restored by using the saved rdb files and info taken from the node.json.