Backup and Restore on Specific Systems

Backup and Restore on NFS (Network File System)

SingleStore DB makes BACKUP DATABASE and RESTORE DATABASE easy to use with a Network File System (NFS) by naming the .backup files so that that no two leaf nodes will attempt to write to the same file even if they are all writing to the same NFS directory.

To back up SingleStore DB with NFS: - Ensure that the same NFS share is mounted in the same directory on the master aggregator and all the leaf nodes (e.g. /mnt/backup_nfs/ ). The OS user must have permissions to access the directory and read the files on all the nodes in the cluster. When running BACKUP DATABASE, simply select a backup_path that points to a directory on that NFS share (e.g. BACKUP DATABASE memsql_demo to '/mnt/backup_nfs/backup_2016_05_04/')

Backup and Restore without NFS

If your cluster is not on NFS and you are restoring a cluster with a different configuration or on different hardware than the original, you must manually distribute partitions across the cluster before running RESTORE DATABASE.

Backup and restore works best if the topology of the source and target clusters are the same.  Since there is no automatic repartitioning the number of the partitions will remain unchanged so it's likely that you will end up with a number of partitions not optimal for the target cluster. If this happens, the parallelism might be affected and the database will need to be repartitioned.

The same directory path must exist on all the leaf nodes and the master aggregator for both  backup and restore. The backup files must be in the same directory on every node. The OS user must be able to access the directory and read the files on all the nodes in the cluster.

If you are running HA, make sure the nodes are paired. Paired nodes must have the same set of partition backups in their local backup directories (specified by backup_path). SingleStore DB will automatically choose master and replica partitions when you run RESTORE DATABASE on the master aggregator.

Backup and Restore on S3 and Azure

Backup and restore can specify an S3 bucket or Azure container or Google Cloud Storage (GCS). In this case, all the backup files across all the leaves (one per partition as described above) are put directly into the S3 bucket or Azure container or GCS. When restore is called, SingleStore will distribute the backup files appropriately and restore the data (similar to how restore from an NFS drive works).

See BACKUP DATABASE and RESTORE DATABASE for syntax and examples.

Backup and Restore between S3 and a local system

See How to Restore an S3 Backup Locally and Vice Versa