Skip to content
madiator edited this page May 23, 2012 · 3 revisions

Create a file raid.xml with the following content

<configuration>
      <policy name = "RaidScanWeekly">
        <srcPath prefix="*"/>
        <codecId>xor</codecId>
        <property>
          <name>targetReplication</name>
          <value>1</value>
          <description> after RAIDing, decrease the replication factor of the file to 
                        this value.
          </description>
        </property>
        <property>
          <name>metaReplication</name>
          <value>1</value>
          <description> the replication factor of the RAID meta file
          </description>
        </property>
        <property>
          <name>modTimePeriod</name>
          <value>100</value>
          <description> time (milliseconds) after a file is modified to make it a
                        candidate for RAIDing
          </description>
        </property>
      </policy>
</configuration>

and hdfs-site.xml with the following:

<?xml version="1.0"?>
  <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

  <!-- Put site-specific property overrides in this file. -->

  <configuration>

  <property>
    <name>dfs.support.append</name>
    <value>true</value>
    <description>Allow append support since we have the HDFS-200 patch and
                 need append/close support for HLog.java#splitLog</description>
  </property>

  <property>
    <name>dfs.replication</name>
    <value>3</value>
  </property>

  <property>
    <name>raid.config.file</name>
    <value>/app/hadoop/conf/raid-refactoring.xml</value>
  </property>

  <property>  
      <name>dfs.permissions</name>  
      <value>false</value>  
      <description>Check for superuser privileges?</description>  
  </property>  

  <property>  
      <name>raid.policy.rescan.interval</name>  
      <value>30000</value>  
      <description>interval in milliseconds between checks for lost files. Default is 1 minute</description>  
  </property> 

  <property>
    <name>raid.codecs.json</name>
    <value>
      [   
        {   
          "id"            : "xor",
          "parity_dir"    : "/raid",
          "stripe_length" : 10, 
          "parity_length" : 1,
          "priority"      : 100,
          "erasure_code"  : "org.apache.hadoop.raid.XorCode",
          "description"   : "XOR code"
        },  
        {   
          "id"            : "rs",
          "parity_dir"    : "/raidrs",
          "stripe_length" : 10,
          "parity_length" : 4,
          "priority"      : 300,
          "erasure_code"  : "org.apache.hadoop.raid.ReedSolomonCode",
          "description"   : "ReedSolomonCode code",
        },  
        {   
          "id"            : "src",
          "parity_dir"    : "/raidsrc",
          "stripe_length" : 10, 
          "parity_length" : 5, 
          "degree"        : 2,
          "erasure_code"  : "org.apache.hadoop.raid.SimpleRegeneratingCode",
          "priority"      : 200,
          "description"   : "SimpleRegeneratingCode code",
        },  
      ]   
    </value>
    <description>JSon string that contains all Raid codecs</description>
  </property>

  </configuration>
Clone this wiki locally