<?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: &amp;quot;How we can change Replication factor when Data is already stored in HDFS? &amp;quot; in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197409#M159460</link>
    <description>&lt;P&gt;Replication factor property is globally set in hdfs-site.xml, the default value is 3. The replication factor for the data stored in the HDFS can be modified by using the below command, &lt;/P&gt;&lt;P&gt;Hadoop fs -setrep -R 5 /
&lt;BR /&gt;Here replication factor is changed to 5 using –setrep command.
&lt;BR /&gt;
&lt;BR /&gt;We can define the replication factor for a file or directory or an entire system by specifying the file or directory or an entire system in the above command
&lt;BR /&gt;File: 
&lt;BR /&gt;hadoop fs –setrep –w 3 /my/file
&lt;BR /&gt;Directory:
&lt;BR /&gt;hadoop fs –setrep –w 3 -R /my/dir&lt;/P&gt;</description>
    <pubDate>Thu, 17 May 2018 14:13:51 GMT</pubDate>
    <dc:creator>shailna_patidar</dc:creator>
    <dc:date>2018-05-17T14:13:51Z</dc:date>
    <item>
      <title>"How we can change Replication factor when Data is already stored in HDFS? "</title>
      <link>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197406#M159457</link>
      <description>&lt;P&gt;I have stored my data in HDFS, now how can I change the replication factor? &lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 15:52:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197406#M159457</guid>
      <dc:creator>shailna_patidar</dc:creator>
      <dc:date>2018-05-16T15:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: "How we can change Replication factor when Data is already stored in HDFS? "</title>
      <link>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197407#M159458</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;A href="@Shailna Patidar"&gt; @Shailna Patidar&lt;/A&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Yes you can do that here is a variation of doing that to a particular file or entire directory&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You can use the below commands to set replication of an individual file to 4 &lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;hadoop dfs -setrep -w 4 /path of the file &lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;The below command will change for all the files under it recursively.To change replication of entire directory under HDFS to 4: &lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;hadoop dfs -setrep -R -w 4 /Directory path&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Hope that helps&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 16:02:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197407#M159458</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2018-05-16T16:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: "How we can change Replication factor when Data is already stored in HDFS? "</title>
      <link>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197408#M159459</link>
      <description>&lt;P&gt;&lt;EM&gt; &lt;A href="https://community.hortonworks.com/questions/191897/@Shailna%20Patidar"&gt;@Shailna Patidar&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Any feedback?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;To check the new replication factor use the below command in this example my_secret has a replication factor of 4&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;$ hdfs dfs -ls
Found 4 items
drwx------   - hive hdfs          0 2014-01-29 06:14 .staging
-rw-r--r--   4 hive hdfs       1943 2014-01-24 01:01 my_secret
drwxr-xr-x   - hive hdfs          0 2014-04-22 12:45 test
drwxr-xr-x   - hive hdfs          0 2014-04-22 12:45 payroll.csv&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Hope that helped&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 23:03:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197408#M159459</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2018-05-16T23:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: "How we can change Replication factor when Data is already stored in HDFS? "</title>
      <link>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197409#M159460</link>
      <description>&lt;P&gt;Replication factor property is globally set in hdfs-site.xml, the default value is 3. The replication factor for the data stored in the HDFS can be modified by using the below command, &lt;/P&gt;&lt;P&gt;Hadoop fs -setrep -R 5 /
&lt;BR /&gt;Here replication factor is changed to 5 using –setrep command.
&lt;BR /&gt;
&lt;BR /&gt;We can define the replication factor for a file or directory or an entire system by specifying the file or directory or an entire system in the above command
&lt;BR /&gt;File: 
&lt;BR /&gt;hadoop fs –setrep –w 3 /my/file
&lt;BR /&gt;Directory:
&lt;BR /&gt;hadoop fs –setrep –w 3 -R /my/dir&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 14:13:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197409#M159460</guid>
      <dc:creator>shailna_patidar</dc:creator>
      <dc:date>2018-05-17T14:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: "How we can change Replication factor when Data is already stored in HDFS? "</title>
      <link>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197410#M159461</link>
      <description>&lt;P&gt;&lt;EM&gt; &lt;A href="https://community.hortonworks.com/questions/191897/@Shailna%20Patidar"&gt;@Shailna Patidar&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Are you still encountering problems, YES globally its ser the hdfs-site.xml but the default is 3. Your question was to change the replication factor of an existing file I think your question was answered.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If you found this answer addressed your question, please take a moment to log in and click the "&lt;STRONG&gt;Accept&lt;/STRONG&gt;" link on the answer. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;That would be a great help to Community users to find the solution quickly for these kinds of question.&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 14:21:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/197410#M159461</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2018-05-17T14:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: "How we can change Replication factor when Data is already stored in HDFS? "</title>
      <link>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/333280#M231400</link>
      <description>&lt;P&gt;If we change the replication factor from Cloudera or Ambari console will it work for existing blocks as well?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 04:27:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/quot-How-we-can-change-Replication-factor-when-Data-is/m-p/333280#M231400</guid>
      <dc:creator>RushiMusale</dc:creator>
      <dc:date>2022-01-06T04:27:46Z</dc:date>
    </item>
  </channel>
</rss>

