Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to delete/remove storage policy ?

avatar
Super Guru

Hi team

From the link below, i see options to set and get storage policies on hdfs for files/dirs

https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html#Set_Stor...

Also hdfs command displays -

hdfs storagepolicies --help
Can't understand command '--help'
Usage: bin/hdfs storagepolicies [COMMAND]
          [-listPolicies]
          [-setStoragePolicy -path <path> -policy <policy>]
          [-getStoragePolicy -path <path>]
          [-help <command-name>]

Can you let me know how to delete if there is any storage policy applied ?

1 ACCEPTED SOLUTION

avatar

Unfortunately, I think can't delete (yet) due to https://issues.apache.org/jira/browse/HDFS-9534

View solution in original post

4 REPLIES 4

avatar

Unfortunately, I think can't delete (yet) due to https://issues.apache.org/jira/browse/HDFS-9534

avatar
Rising Star

There is no specific 'removeStoragePolicy' command.

So what you want to do, I guess, is to get it back to the default value, right? The workaround is you could use '-setStoragePolicy' to set it to 'HOT'(default value), or you could use '-getStoragePolicy' to check the policy of the parent directory first and then use '-setStoragePolicy' to set it.

avatar
Expert Contributor

Hi Sagar, Currently I don't think there is remove storage policy function. The only way is to copy/move data to a new dir and then delete and rename the new one created.

avatar

@Sagar Shimpi

As we moved into 2017, we can now remove storage policy for a certain path!

hdfs storagepolicies -unsetStoragePolicy -path <path>