Commands for configuring storage policies
Depending on your requirements, use the hdfs storagepolicy sub-commands to set storage policies or list the storage policies applied on a file or a directory.
Setting storage policies
Command: hdfs storagepolicies -setStoragePolicy -path <path> -policy <policyName>Argument | Description |
---|---|
<path> | The path to a directory or file. |
<policyName> | The name of the storage policy. |
hdfs storagepolicies -setStoragePolicy -path /cold1 -policy
COLD
Listing storage policies
Command: hdfs storagepolicies -getStoragePolicy -path <path>Argument | Description |
---|---|
<path> | The path to a directory or file. |
hdfs storagepolicies -getStoragePolicy -path /cold1