Create a snapshot policy
You can use Cloudera Manager to create snapshot policies for a directory.
-
Select Backup > Snapshot Policies in the left navigation bar.
Existing snapshot policies are shown in a table on the Snapshot Policies page.
-
Click Create Snapshot Policy.
The Create Snapshot Policy window displays.
- From the drop-down list, select the service (HDFS or HBase) and cluster for which you want to create a policy.
- Provide a name for the policy and, optionally, a description.
-
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 snapshot creation. If no directories are enabled
for snapshot creation, 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.*
match all tables with names starting withfinance
. You can also create a snapshot for all tables in a given namespace, using the{namespace}:.*
syntax.
- 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 snapshot creation. If no directories are enabled
for snapshot creation, a warning displays.
-
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.
-
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.
-
Click Save Policy.
The new Policy displays on the Snapshot Policies page.