Using erasure coding for existing data

You must set a supported EC policy for a directory and copy the existing data to the directory.

  1. Create a new directory or choose an existing directory.
  2. View the supported EC policies.
    hdfs ec -listPolicies
  3. Enable a supported EC policy.
    hdfs ec -enablePolicy -policy <policy>
  4. Set the EC policy for the directory you want to use.
    hdfs ec -setPolicy -path <directory> [-policy <policyName>]
    • path. Required. Specify the HDFS directory you want to apply the EC policy to.
    • policy. Optional. The EC policy you want to use for the directory you specified. If you do not provide this parameter, the EC policy you specified in the Default Policy when Setting Erasure Coding setting from Cloudera Manager is used.
  5. Copy the data to the directory you set an EC policy for.
    You can use the distcp tool or Cloudera Manager's Backup and Disaster Recovery process.