What is HDFS Snapshot Policy
You can create Snapshot Policies using Cloudera Manager for taking an automated snapshot of snapshottable paths on HDFS. The snapshot policies run at the time specified (hourly, daily, weekly etc) by the user. Before we can create a Snapshot policy we must allow snapshot on the HDFS directory first.
Configuring a Snapshot Policy
The following are the steps to create a snapshot policy for snapshottable paths on HDFS:
1. Navigate to Backups > Snapshots to configure a HDFS snapshot policy.
2. Currently, we do not have any policy configured. Click on “Create snapshot policy” to create a new policy.
3. As you see in the preceding screenshot, we have provided the name of the policy (test_snap_policy) and HDFS Path (/user/test) for which the policy is to be configured. You can provide multiple paths in a single policy as well.
The policy is configured to take a snapshot hourly at 55 minutes and it will save the last 2 snapshots and delete the rest. You can set the alerts to be sent on success, failure, start and abort of the policy. We have selected “On Success” and “On Failure” options to send alerts.
4. You should see the policy configured. Currently, the policy is not yet run as shown in the screenshot below.
View the Snapshot History
Once the policy is run as per the schedule you can see the “Last Run” of the snapshot policy on the “Snapshot Policies” page as shown in the screenshot below.
To list out all the history of past snapshots taken under a specific policy, select the “Show History” option under the “Actions” drop-down menu.
Disable/delete Snapshot Policy
Snapshot policies once configured will run until you either disable them or delete them. To disable a snapshot policy select “Disable” option under “Actions” drop-down.
Similarly, to delete the policy select “Delete” option under “Actions” drop-down.
Confirm the deletion of the snapshot on the next window.