Managing snapshot policies

You must enable an HDFS directory for snapshots to allow snapshot policies to be created for that directory.

To create a snapshot policy:

  1. From Cloudera Manager, select Replication > Snapshot Policies in the left navigation bar.

    Existing snapshot policies are shown in a table.

  2. To create a new policy, click Create Snapshot Policy.
  3. From the drop-down list, select the service (HDFS or HBase) and cluster for which you want to create a policy.
  4. Provide a name for the policy.
  5. Optionally, provide a description.
  6. Specify the directories, namespaces or tables to include in the snapshot.
    • For an HDFS service, select the paths of the directories to include in the snapshot. The drop-down list allows you to select only directories that are enabled for snapshotting. If no directories are enabled for snapshotting, a warning displays.

      Click to add a path and to remove a path.

    • For an HBase service, list the tables to include in your snapshot. You can use a Java regular expression to specify a set of tables. For example, finance.* matchs all tables with names starting with finance. You can also create a snapshot for all tables in a given namespace, using the {namespace}:.* syntax.
  7. Specify the snapshot Schedule. You can schedule snapshots hourly, daily, weekly, monthly, or yearly, or any combination of those. Depending on the frequency you select, you can specify the time of day to take the snapshot, the day of the week, day of the month, or month of the year, and the number of snapshots to keep at each interval. Each time unit in the schedule information is shared with the time units of larger granularity. That is, the minute value is shared by all the selected schedules, hour by all the schedules for which hour is applicable, and so on. For example, if you specify that hourly snapshots are taken at the half hour, and daily snapshots taken at the hour 20, the daily snapshot will occur at 20:30.

    To select an interval, check its box. Fields display where you can edit the time and number of snapshots to keep. For example:

  8. Specify whether Alerts should be generated for various state changes in the snapshot workflow. You can alert on failure, on start, on success, or when the snapshot workflow is aborted.
  9. Click Save Policy.

    The new Policy displays on the Snapshot Policies page.

To edit or delete a snapshot policy

  1. From Cloudera Manager, select Replication > Snapshot Policies in the left navigation bar.

    Existing snapshot policies are shown in a table.

  2. Click the Actions menu shown next to a policy and select Edit or Delete.

Errors might appear when you edit or delete a snapshot policy that contains the characters % . ; / \ or any character that is not ASCII printable which includes the ASCII characters less than 32 and the ASCII characters that are greater than or equal to 127. To resolve this issue, use the update command to replace the unsupported character in the policy name with an underscore, in the SNAPSHOT_POLICIES table.

To update the policy name in the SNAPSHOT_POLICIES table, perform the following steps:

  1. Take a backup of the Cloudera Manager database.
  2. Run the following command to replace the unsupported character in the policy name with an underscore:

    update SNAPSHOT_POLICIES set NAME = replace(NAME,CHAR([***Enter character number***]),'_');