In this tutorial, we focus on HDFS snapshots. Common use cases of HDFS snapshots include backups and protection against user errors.

Create a snapshot of HDFS directory:

HDFS directories must be enabled for snapshots in order for snapshots to be created. Steps are:

  • From the Clusters tab -> select HDFS service.
  • Go to the File Browser tab. Select the file directory.


  • Verify the Snapshottable Path and click Enable Snapshots.


With Command line:

Once directory has been enabled for snapshots, take a snapshot.

  • To take a snapshot, click Take Snapshot, specify the name of the snapshot, and click Take Snapshot.


The snapshot is added to the snapshot list.


With Command line:

Remove the file from snapshot:

Now, let’s “accidentally” remove a file inside the snapshotable directory:

Recover the file from snapshot:

To restore a snapshot, click drop down button near folder name again and select restore from snapshot.


Select the snap from and select the restore method.


Restore in progress.


With Command line:

Recovering from the snapshot is as simple as copying the file.

You can read the content of the file or list the file.

Disable Snapshot:

Try to remove a snapshotable directory by typing a following command as the hdfs user. As expected, the directory can’t be deleted because is snapshottable and it already contains a snapshot. Remove the snapshot first and re-try again.



Delete the snapshot.


From command line.



Leave a Reply