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

S3 backup #107

Merged
merged 6 commits into from
Aug 27, 2020
Merged

S3 backup #107

merged 6 commits into from
Aug 27, 2020

Conversation

drpebcak
Copy link
Contributor

This is an initial, sort of naive implementation to allow backing up the stan file store. I'm looking for some feedback on approach here. Addresses #104 and #106

@wallyqs
Copy link
Member

wallyqs commented Aug 26, 2020

I think this approach LGTM, I like that it is using the environment variables via a secret. Should maybe add optional resources for the backup container pod so that it does not steal cycles from the nats-streaming server one during the backup process? Also would be good to add a usage example in the README from the chart before merging. Thanks for the contribution!

args:
- |
while true; do
curl -s 127.0.0.1:8222/streaming/serverz | grep 'Leader'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talking to @kozlovic on whether only backup the Leader, and we now think that it might be simpler and safer to backup leader and follower nodes as well into different folders using the $POD_NAME, something like:

aws s3 cp {{ .Values.store.volume.mount }}/* {{ .Values.store.backup.s3Path }}/$POD_NAME

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Backup each node regardless of their leadership status. This would prevent issues when leadership changes and file stores are not necessarily yet at the same stage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, just removed the check for Leader, and also added a prefix using stan.name/POD_NAME to make sure different deployments of stan could use the same bucket without collisions.

@drpebcak drpebcak marked this pull request as ready for review August 26, 2020 23:58
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@wallyqs wallyqs merged commit d09587e into nats-io:master Aug 27, 2020
@drpebcak drpebcak deleted the s3-backup branch August 27, 2020 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants