Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)

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

3,675 Views
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎10-08-2016 04:18 PM
Updated by:
 
Contributors
Top Kudoed Authors