This is documentation for MapR Version 5.0. You can also refer to MapR documentation for the latest release.

Skip to end of metadata
Go to start of metadata

A snapshot is a read-only image of a volume at a specific point in time. On clusters with an Enterprise Edition or higher license, you can create a snapshot manually or automate the process with a schedule. Snapshots are useful any time you need to be able to roll back to a known good data set at a specific point in time. For example, before performing a risky operation on a volume, you can create a snapshot to enable rollback capability for the entire volume. A snapshot takes no time to create, and initially uses no disk space, because it stores only the incremental changes needed to roll the volume back to the state at the time the snapshot was created. The storage used by a volume's snapshots does not count against the volume's quota. When you view the list of volumes on your cluster in the MapR Control System, the value of the Snap Size column is the disk space used by all of the snapshots for that volume.

Icon

Snapshot volumes inherit the auditing configurations of their original read-write volumes. For details about auditing, see Auditing of Cluster Administration and Operations on Directories, Files, and Tables.

The following sections describe procedures associated with snapshots:

 See a video explanation of snapshots

Creating a Volume Snapshot

You can create a snapshot manually or use a schedule to automate snapshot creation. Each snapshot created by a schedule has an expiration date that determines how long the snapshot is retained. When you schedule snapshots, the expiration date is determined by the Retain parameter of the schedule.

For more information about scheduling snapshots, see Scheduling a Snapshot.

Creating a Snapshot Manually

You can create a snapshot using the volume snapshot create command, or use the following procedure to create a snapshot using the MapR Control System.

To create a snapshot using the MapR Control System:

  1. In the Navigation pane, expand the MapR-FS group and click the Volumes view.
  2. Select the checkbox beside the name of each volume for which you want a snapshot, then click the New Snapshot button to display the Snapshot Name dialog.
  3. Type a name for the new snapshot in the Name... field.
  4. Click OK to create the snapshot.

Scheduling a Snapshot

You schedule a snapshot by associating an existing schedule with a volume. You can schedule snapshots on mirror volumes also; however, because mirrors are read-only, creating a snapshot of a mirror does not provide any real benefit. You can schedule a snapshot by passing the ID of a schedule to the volume modify command, or you can use the following procedure to choose a schedule for a volume using the MapR Control System.

To schedule a snapshot using the MapR Control System:

  1. In the Navigation pane, expand the MapR-FS group and click the Volumes view.
  2. Display the Volume Properties dialog by clicking the volume name, or by selecting the checkbox beside the name of the volume then clicking the Properties button.
  3. In the Replication and Snapshot Scheduling section, choose a schedule from the Snapshot Schedule dropdown menu.
  4. Click Modify Volume to save changes to the volume.

For information about creating a schedule, see Schedules.

Viewing the Contents of a Snapshot

At the top level of each volume is a directory called .snapshot containing all the snapshots for the volume. You can view the directory with hadoop fs commands or by mounting the cluster with NFS. To prevent recursion problems, ls and hadoop fs -ls do not show the .snapshot directory when the top-level volume directory contents are listed. You must navigate explicitly to the .snapshot directory to view and list the snapshots for the volume.

For example:


Viewing a List of Snapshots

Viewing all Snapshots

You can view snapshots for a volume with the volume snapshot list command or using the MapR Control System.

To view snapshots using the MapR Control System:

  • In the Navigation pane, expand the MapR-FS group and click the Snapshots view.

Viewing Snapshots for a Volume

You can view snapshots for a volume by passing the volume to the volume snapshot list command or using the MapR Control System.

To view snapshots using the MapR Control System:

  1. In the Navigation pane, expand the MapR-FS group and click the Volumes view.
  2. Click the Snapshots button to display the Snapshots for Volume dialog.

Removing Old Snapshots

Each snapshot has an expiration date and time, when it is deleted automatically. You can remove a snapshot manually before its expiration, or you can preserve a snapshot to prevent it from expiring.

You can remove a snapshot using the volume snapshot remove command, or use the following procedure to remove a snapshot using the MapR Control System.

To remove a snapshot using the MapR Control System:

  1. In the Navigation pane, expand the MapR-FS group and click the Snapshots view.
  2. Select the checkbox beside each snapshot you wish to remove.
  3. Click Remove Snapshot to display the Remove Snapshots dialog.
  4. Click Yes to remove the snapshot or snapshots.

To remove a snapshot from a specific volume using the MapR Control System:

  1. In the Navigation pane, expand the MapR-FS group and click the Volumes view.
  2. Select the checkbox beside the volume name.
  3. Click Snapshots to display the Snapshots for Volume dialog.
  4. Select the checkbox beside each snapshot you wish to remove.
  5. Click Remove to display the Remove Snapshots dialog.
  6. Click Yes to remove the snapshot or snapshots.

Preserving a Volume Snapshot

You can preserve a snapshot using the volume snapshot preserve command, or use the following procedure to create a volume using the MapR Control System.

To remove a snapshot using the MapR Control System:

  1. In the Navigation pane, expand the MapR-FS group and click the Snapshots view.
  2. Select the checkbox beside each snapshot you wish to preserve.
  3. Click Preserve Snapshot to preserve the snapshot or snapshots.

To remove a snapshot from a specific volume using the MapR Control System:

  1. In the Navigation pane, expand the MapR-FS group and click the Volumes view.
  2. Select the checkbox beside the volume name.
  3. Click Snapshots to display the Snapshots for Volume dialog.
  4. Select the checkbox beside each snapshot you wish to preserve.
  5. Click Preserve to preserve the snapshot or snapshots.

Restoring From a Snapshot

Restoring data from a snapshot involves a simple copy operation from the .snapshot directory to the destination, as in the following example. User input is marked in bold:

[user@host]$ maprcli volume snapshot create -snapshotname uservolsnap -volume users
[user@host]$ maprcli volume snapshot list
cumulativeReclaimSizeMB  creationtime                  ownername  snapshotid  snapshotname  volumeid   volumename  ownertype  volumepath  
0                        Fri May 09 16:31:55 UTC 2014  mapr       256000049   uservolsnap   152963782  users       1          /user       

[user@host]$ hadoop fs -ls /user
Found 3 items
drwxr-xr-x   - root root          1 2014-05-06 10:09 /user/hive
drwxr-xr-x   - mapr mapr          4 2014-05-09 16:20 /user/mapr
drwxr-xr-x   - root root          2 2014-05-07 16:05 /user/root

[user@host]$ hadoop fs -ls /user/.snapshot
Found 1 items
drwxr-xr-x   - mapr mapr          3 2014-05-06 16:00 /user/.snapshot/uservolsnap

[user@host]$ hadoop fs -ls /user/.snapshot/uservolsnap
Found 3 items
drwxr-xr-x   - root root          1 2014-05-06 10:09 /user/.snapshot/uservolsnap/hive
drwxr-xr-x   - mapr mapr          4 2014-05-09 16:20 /user/.snapshot/uservolsnap/mapr
drwxr-xr-x   - root root          2 2014-05-07 16:05 /user/.snapshot/uservolsnap/root

[user@host]$ hadoop fs -cp /user/.snapshot/uservolsnap/mapr/* ~/mapr

 

  • No labels