Restoring a backup to a specific point-in-time

About this task

For a point-in-time restore, OpsCenter intelligently chooses which snapshots and commit logs to restore from based on the date and time you are restoring the cluster to. If an acceptable combination of snapshots and commit logs cannot be found, the restore fails. A detailed error message is visible in the Activity section of the OpsCenter UI.

The Backup Service requires control over the data and structure of its destination locations. The backup destinations must be dedicated for use only by OpsCenter. Any additional directories or files in those destinations can prevent the Backup Service from properly conducting a Backup or Restore operation.

Keep the following caveats in mind when creating and restoring backups:

  • Restoring a snapshot that contains only the system keyspace is not allowed. There must be both system and non-system keyspaces, or only non-system keyspaces in the snapshot you want to restore.

  • Restoring a snapshot that does not contain a table definition is not allowed.

  • Restoring a snapshot to a location with insufficient disk space fails. The Restore Report indicates which nodes do not have sufficient space and how much space is necessary for a successful restore. For more information and tips for preventative measures, see Monitoring sufficient disk space for restoring backups.

  • OpsCenter does not back up indexes. Therefore, DSE must recompute the indexes after a restore.

Prerequisites

For point-in-time restores to work, you must enable commit log backups and complete at least one snapshot backup before the time to which you are restoring.

When performing a point-in-time restore, the cluster topology must not have changed since the backup. Attempting to perform a point-in-time restore on a cluster whose topology has changed will fail. DataStax strongly recommends performing a snapshot backup both before and after changing the cluster topology. After changing the topology, you can then restore the cluster based on that backup. If reverting to the previous topology, you can use the backup with the original topology to restore the cluster.

Known limitations

  • Point-in-time restore fails if any tables were recreated during the time period of the actual point-in-time restore.

  • For point-in-time restores, you cannot choose a different cluster because the commitlog cannot be played on a different node other than the one it was recorded.

Procedure

  1. Select cluster name > Services.

  2. Select the Details link for the Backup Service.

  3. Click Restore Backup.

    The Restore from Backup, Step 1 of 2: Select Backup dialog appears.

  4. Click the Point In Time tab.

    PITrestoreStep1

  5. Complete your selections:

    1. Required: Point in Time: Set the date and time to which you want to restore your data.

    2. Required: Commit logs location: Select the location of the commit logs; either On Server, Local FS, or in a supported cloud. The location of commit logs is configured when enabling commit log backups.

    3. Required: Backup location: Select the location of the snapshot; either On Server, Local FS, or in a supported cloud. Click the +Add Location link to add another location.

    4. Click Next.

      The Restore from Backup, Step 2 of 2: Configure and Restore dialog appears.

      Step 2 of 2: Configure and Restore (PIT)

  6. In Keyspaces and Graphs, select the tables or graphs you want to restore.

    • Click All Keyspaces or All Graphs to restore all keyspaces or all graphs.

    • Click the keyspace name or graph name to include all tables or all graphs in the keyspace.

    • To select specific tables or graphs, expand the keyspace name or graph name and select the specific tables or graphs to back up.

      For DSE 6.0.0-6.0.4, when restoring a DSE Graph backup without selecting Use sstableloader, DSE must be restarted to ensure all data is available.

  7. Optional: To remove the existing keyspace data before the data is restored, select Truncate/delete existing data before restore. This completely removes any updated data in the cluster for the keyspaces you are restoring.

    Choosing to not truncate or delete existing data can be selected only when sstableloader is used for the restore. If not using sstableloader, truncating or deleting existing data is selected by default.

  8. To prevent overloading the network, set a maximum transfer rate for the restore using the Throttle DSE stream throughput at __ MB option.

    To enter a value for this option, you must select Use sstableloader. Otherwise, the transfer rate value is ignored.

  9. Optional: To bulk load external data into a cluster, select Use sstableloader.

    Using sstableloader restores data to a cluster regardless of its original topology, at the expense of speed and performance. Restoring to a cluster that uses tiered storage requires using sstableloader. See sstableloader for details.

    When restoring from a backup, OpsCenter might report that the restore was successful, even if it failed. This behavior can occur when copying SSTables into the new data directories and running nodetool refresh afterward. To determine whether the restore failed, search the DataStax Agent logs for a string indicating "Error copying sstables to data dir:". This issue is present only in OpsCenter 6.8.0.

  10. Optional: If necessary, change the staging directory by setting the backup_staging_directory configuration option in address.yaml.

  11. Optional: Click the Edit Restart Settings link to adjust settings for the rolling restart. The default is a 60 second pause after restarting each node. Point-in-Time restores require a rolling restart of all nodes.

  12. Click Restore Backup.

    The Confirm Restore dialog appears.

    Confirm restore operation dialog

    If a value was not set for throttling stream output, a warning message indicates the consequences of unthrottled restores. Take one of the following actions:

    • Click Cancel and set the throttle value in the Restore from Backup dialog.

    • Set the stream_throughput_outbound_megabits_per_sec and inter_dc_stream_throughput_outbound_megabits_per_sec values in cassandra.yaml.

    • Proceed anyway at the risk of creating network bottlenecks.

    If using LCM to manage DSE cluster configuration, update Cluster Communication settings in cassandra.yaml in the configuration profile for the cluster and run a configuration job. Stream throughput (not inter-dc) is set to 200 in LCM defaults.

    Update throttle options in LCM

  13. Click Start Restore to confirm when prompted.

Results

OpsCenter retrieves the backup data and sends the data to the nodes in the cluster. A snapshot restore is completed first, following the same process as a normal snapshot restore. After the snapshot restore successfully completes, OpsCenter instructs all agents in parallel to download the necessary commit logs, followed by a rolling commit log replay across the cluster. Each node is configured for replay and restarted after the previous node finishes successfully.

If an error occurs during a point-in-time restore for a subset of tables, you might need to manually revert changes made to some cluster nodes. To clean up a node, locate and edit dse-env.sh and remove the last line that specifies JVM_OPTS. The default location of this file depends on the type of installation:

Package installations

/etc/dse/dse-env.sh

Tarball installations

installation_location/bin/dse-env.sh

For example, remove:

export JVM_OPTS="$JVM_OPTS -Dcassandra.replayList=Keyspace1.Standard1"

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com