<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to change the replication factor of data which is already stored in HDFS ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-replication-factor-of-data-which-is/m-p/222277#M184149</link>
    <description>&lt;P&gt;\r\ndfs.replication \r\n4 // To change the replication factor to 4\r\nBlock Replication \r\n \r\nhdfs-site.xml is used to configure HDFS. Changing the dfs.replication property in hdfs-site.xml will change the default replication for all files placed in HDFS.\r\nYou can also change the replication factor on a per-file basis using the Hadoop FS shell.\r\n[training@localhost ~]$ hadoop fs –setrep –w 4 /my/file\r\nAlternatively, you can change the replication factor of all the files under a directory.\r\n[training@localhost ~]$ hadoop fs –setrep –w 4 -R /my/dir\r\n"}" data-sheets-userformat="{"2":769,"3":[null,0],"11":4,"12":0}"&amp;gt;The file that is loaded into HDFS which has a default Replication Factor of 3, is set in hdfs-site.xml file. The replication of that particular file would be 3, which means 3 copies of the block exists on the HDFS. &lt;/P&gt;&lt;P&gt;To change the replication factor, open the hdfs-site.xml file. This file is usually found in the conf/ folder of the &lt;A href="https://data-flair.training/blogs/hadoop-2-6-multinode-cluster-setup/"&gt;Hadoop installation&lt;/A&gt; directory. Change or add the following property to hdfs-site.xml: &lt;BR /&gt;&amp;lt;property&amp;gt; &lt;BR /&gt;&amp;lt;name&amp;gt;dfs.replication&amp;lt;name&amp;gt; &lt;BR /&gt;&amp;lt;value&amp;gt;4&amp;lt;value&amp;gt; // To change the replication factor to 4 &lt;BR /&gt;&amp;lt;description&amp;gt;Block Replication&amp;lt;description&amp;gt; &lt;BR /&gt;&amp;lt;property&amp;gt; &lt;BR /&gt;hdfs-site.xml is used to configure HDFS. Changing the dfs.replication property in hdfs-site.xml will change the default replication for all files placed in HDFS. &lt;BR /&gt;You can also change the replication factor on a per-file basis using the Hadoop FS shell. &lt;BR /&gt;[training@localhost ~]$ Hadoop fs –setrep –w 4 /my/file &lt;BR /&gt;Alternatively, you can change the replication factor of all the files under a directory. &lt;BR /&gt;[training@localhost ~]$ Hadoop fs –setrep –w 4 -R /my/dir&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jun 2018 19:13:39 GMT</pubDate>
    <dc:creator>patelharshali13</dc:creator>
    <dc:date>2018-06-14T19:13:39Z</dc:date>
  </channel>
</rss>

