简体   繁体   中英

How to delete a snapshot in HDFS?

What's the correct way to delete a snapshot in HDFS? Such as the follow:

/folder/path/.snapshot/snapshot-20160101

From documentation I can see there's a command

hdfs dfs -deleteSnapshot <path> <snapshotName>

but not entirely sure how to use it.

Is /folder/path/.snapshot/ the <path> and snapshot-20160101 the <snapshotName> ?

Yes @ oulwj12 , you are right.

The path is /folder/path/ and the name is snapshot-20160101 . Please note that according the referenced documentation path means the path of the snapshottable directory.

So your command should be something like

hdfs dfs -deleteSnapshot /folder/path/ snapshot-20160101

I faced a little difficulty with the same and I tried it on my cluster so here we go :

hdfs dfs -deleteSnapshot /path/ (just before .snapshot folder starts, don't mention .snapshot) snapshot-xxxxx(snapshot name is .snapshot directory)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM