GridGain Developers Hub

Data Snapshots and Recovery

GridGain provides the ability to create snapshots of data stored cluster-wide, that can later be used for cluster recovery purposes. Having snapshots at hand, they can be used to recover the cluster to a state recorded in a snapshot.

Creating Full Snapshots

To create a full snapshot, use the cluster snapshot create CLI command. In the command, you can specify the list of fully qualified table names to create snapshots of, or specify the --all option to create a snapshot of all tables. For example:

cluster snapshot create --tables=PERSON

The command above creates a snapshot of a table Person in the PUBLIC schema.

Restoring Snapshots

To restore snapshots, you can use the cluster snapshot restore command.

To make sure your snapshot is restored correctly, follow these guidelines:

  • Make sure that the cluster topology is the same as the one snapshot was taken on.

  • Stop traffic to the cluster during restoration to avoid possible inconsistencies and failed operations.

When you are prepared to restore data to the cluster, run the restore command. For example:

cluster snapshot restore --id=112646727522648064

The command above restores all tables in the snapshot with the specified ID.

You can also choose to only restore specific tables stored in the snapshot, instead of all of them. In this case, specify the fully qualified table names of the tables to restore, for example:

cluster snapshot restore --id=112646727522648064 --tables=PERSON

Checking Snapshot Status

You can check the status of the specific snapshot by using the cluster snapshot status command to see what operations were performed with it. By default, this command provides information about all snapshots in the cluster. You can narrow information down by providing the snapshot ID. If you do, you can also use the --all-nodes option to see information about the snapshot on each specific node in the cluster. For example:

cluster snapshot status --id=112646727522648064  --all-nodes

The command above returns information about all operations with the snapshots per node.