nats-server icon indicating copy to clipboard operation
nats-server copied to clipboard

How to backup whole nats-server with every users data

Open masudur-rahman opened this issue 3 years ago • 4 comments

Hello, I have a jetstream enabled nats-server with multiple accounts and some Streams.

Now, I want to start the nats-server with clustering enabled.

But the problem I'm facing is how can I backup everything (with every streams of every users) from my previous nats-server to my new nats-server with clustering enabled.

I have tried https://docs.nats.io/jetstream/disaster_recovery#data-backup, but it only backs up data of a specified user but I want everything to be backed up. Any idea or suggestion how can I achieve this ?

masudur-rahman avatar Aug 27 '21 05:08 masudur-rahman

We do not currently have a tool for this, but shutting down one server in a cluster and taking a snapshot should work well and ensure you have a point in time. It will catch up when it starts again.

ripienaar avatar Aug 27 '21 13:08 ripienaar

I may be wrong here but can't you just change the config on the single server to be clustered and start the new servers? The system should do the right thing.

derekcollison avatar Aug 27 '21 14:08 derekcollison

@derekcollison,

I think this topic should be revisited. We need some way to backup a server/cluster without bringing it down to support backing up a 24/7 running cluster.

Restoring the full backup should naturally be offline before restarting the server(s)

I'm fine with something in nats-cli and/or something that is a signal to the server to dump a full consistent snapshot of all accounts and their data to some folder that normal backup can capture when the dump is complete.

Sry if this already exist, been looking for it. /T

tpihl avatar Aug 14 '23 18:08 tpihl

We allow backing up all assets in an account via the NATS cli, but not cross accounts.

By default we do not have the ability to operate on an account owner's behalf to issue the snapshot / backup calls.

Some of the team has been working on opt-in solutions for SCP to allow a system account to operate in this manner if a user wants to chose to do so.

derekcollison avatar Aug 14 '23 20:08 derekcollison