Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar

Administrator Operations

The operations described in this section require superuser privileges.

  • Allow Snapshots: Allowing snapshots of a directory to be created. If the operation completes successfully, the directory becomes snapshottable.
    • Command:
    • hadoop dfsadmin -allowSnapshot $path
      		
    • Arguments:
    • path – The path of the snapshottable directory.
    • See also the corresponding Java API void allowSnapshot(Path path) in HdfsAdmin.
  • Disallow Snapshots: Disallowing snapshots of a directory to be created. All snapshots of the directory must be deleted before disallowing snapshots.
    • Command:
    • hadoop dfsadmin -disallowSnapshot $path
      		
    • Arguments:
    • path – The path of the snapshottable directory.
    • See also the corresponding Java API void disallowSnapshot(Path path) in HdfsAdmin.

User Operations

The section describes user operations. Note that HDFS superuser can perform all the operations without satisfying the permission requirement in the individual operations.

  • Create Snapshots: Create a snapshot of a snapshottable directory. This operation requires owner privilege to the snapshottable directory.
    • Command:
    • hadoop dfs -createSnapshot $path $snapshotName
      		
    • Arguments:
      path The path of the snapshottable directory.
      snapshotName The snapshot name, which is an optional argument. When it is omitted, a default name is generated using a timestamp with the format "'s'yyyyMMdd-HHmmss.SSS", e.g. "s20130412-151029.033".
    • See also the corresponding Java API Path createSnapshot(Path path) and Path createSnapshot(Path path, String snapshotName) in FileSystem. The snapshot path is returned in these methods.
  • Delete Snapshots: Delete a snapshot of from a snapshottable directory. This operation requires owner privilege of the snapshottable directory.
    • Command:
    • hadoop dfs -deleteSnapshot $path $snapshotName
      		
    • Arguments:
      path The path of the snapshottable directory.
      snapshotName The snapshot name.
    • See also the corresponding Java API void deleteSnapshot(Path path, String snapshotName) in FileSystem.
  • Rename Snapshots: Rename a snapshot. This operation requires owner privilege of the snapshottable directory..
    • Command:
    • hadoop dfs -renameSnapshot $path $oldName $newName
      		
    • Arguments:
      path The path of the snapshottable directory.
      oldName The old snapshot name.
      newName The new snapshot name.
    • See also the corresponding Java API void renameSnapshot(Path path, String oldName, String newName) in FileSystem.
  • Get Snapshottable Directory Listing: Get all the snapshottable directories where the current user has permission to take snapshots.
    • Command:
    • hadoop lsSnapshottableDir $path $snapshotName
      		
    • Arguments:
      path The path of the snapshottable directory.
      snapshotName The snapshot name.
    • See also the corresponding Java API SnapshottableDirectoryStatus[] getSnapshottableDirectoryListing() in DistributedFileSystem.
  • Get Snapshots Difference Report: Get the differences between two snapshots. This operation requires read access privilege for all files/directories in both snapshots.
    • Command:
    • hadoop snapshotDiff $path $fromSnapshot $toSnapshot
      		
    • Arguments:
      path The path of the snapshottable directory.
      fromSnapshot The name of the starting snapshot.
      toSnapshot The name of the ending snapshot.

 

**See Also**

HDFS Snapshots - 1) Overview

5,708 Views
Version history
Last update:
‎10-08-2016 04:18 PM
Updated by:
Contributors