Restore from an MSR backup

In the event that a majority of the RethinkDB table replicas in use by MSR are unhealthy, and an emergency repair is unsuccessful, you must restore the cluster from a backup.

To restore MSR from a backup:

  1. Set up an MSR instance to serve as the restore target.

  2. Verify that the MSR version in use by the cluster matches the one used to create the backup.

  3. Extract your backup:

    • If MSR is configured to store images on the local file system, run the following command:

      sudo tar -xf image-backup.tar -C /var/lib/docker/volumes
      
    • If MSR uses a different storage back end, follow the best practices recommended for that system.

  4. Use the msr restore command to restore MSR metadata from a previously created backup. The command is present in any API Pod and can be run using the kubectl exec command.

    The following is an example of restoring onto an MSR installation named mymsr. The backup contents are streamed from standard input, which receives its data from the local file backup.tar.

    kubectl exec -i deployment.apps/<msr-installation-name> -- msr restore - < backup.tar
    
  5. Register MSR with eNZi (auth service):

    1. Run the msr auth register admin command:

      kubectl exec -i deployment.apps/mymsr-api -- msr auth register --username
      admin -p password https://mymsr-enzi:4443/enzi
      
    2. Restart MSR Pods:

      kubectl rollout restart deployment mymsr-api mymsr-enzi-api mymsr-garant mymsr-registry
      
  6. If you scan images in MSR, you must update the vulnerability database in the MSR UI. Refer to Enable MSR security scanning for more information.

After you successfully restore MSR, you can join new replicas as you would following a fresh installation.