<?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 fix missing and under replicated blocks? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153582#M20546</link>
    <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/2766/sinhapranshu.html"&gt;Pranshu Pranshu&lt;/A&gt;, You can use "setrep" command for setting replication factor for files and directories:&lt;/P&gt;&lt;H2&gt;setrep&lt;/H2&gt;&lt;P&gt;Usage: hadoop fs -setrep [-R] [-w] &amp;lt;numReplicas&amp;gt; &amp;lt;path&amp;gt;&lt;/P&gt;&lt;P&gt;Changes the replication factor of a file. If &lt;EM&gt;path&lt;/EM&gt; is a directory then the command recursively changes the replication factor of all files under the directory tree rooted at &lt;EM&gt;path&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Options:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;The -w flag requests that the command wait for the replication to complete. This can potentially take a very long time.&lt;/LI&gt;&lt;LI&gt;The -R flag is accepted for backwards compatibility. It has no effect.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;To set replication of an individual file to 3, you can use below command:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;./bin/hadoop dfs -setrep -w 3 /path/to/file&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;You can also do this recursively. To change replication of entire HDFS to 3, you can use below command:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;./bin/hadoop dfs -setrep -R -w 3 /&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Exit Code:&lt;/P&gt;&lt;P&gt;Returns 0 on success and -1 on error.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Hope this helps you to solve this problem?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2016 17:58:05 GMT</pubDate>
    <dc:creator>rushikeshdeshmu</dc:creator>
    <dc:date>2016-02-24T17:58:05Z</dc:date>
    <item>
      <title>How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153574#M20538</link>
      <description>&lt;P&gt;In my HDFS status summary, I see the following messages about missing and under-replicated blocks:&lt;/P&gt;&lt;P&gt;2,114 missing blocks in the cluster. 5,114,551 total blocks in the cluster. Percentage missing blocks: 0.04%. Critical threshold: any.&lt;/P&gt;&lt;P&gt;On executing the command : hdfs fsck -list-corruptfileblocks&lt;/P&gt;&lt;P&gt;I got following output : The filesystem under path '/' has 2114 CORRUPT files&lt;/P&gt;&lt;P&gt; What is the best way to fix these corrupt files and also fix the underreplicated block problem?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 17:12:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153574#M20538</guid>
      <dc:creator>sinha_pranshu</dc:creator>
      <dc:date>2016-02-23T17:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153575#M20539</link>
      <description>&lt;P&gt;Hi Pranshu,&lt;/P&gt;&lt;P&gt;You can follow the instructions in the link below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/4427/fix-under-replicated-blocks-in-hdfs-manually.html" target="_blank"&gt;https://community.hortonworks.com/articles/4427/fix-under-replicated-blocks-in-hdfs-manually.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Karthik Gopal&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 17:19:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153575#M20539</guid>
      <dc:creator>kgopal</dc:creator>
      <dc:date>2016-02-23T17:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153576#M20540</link>
      <description>&lt;P&gt;More information:&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/19205057/how-to-fix-corrupt-hadoop-hdfs"&gt;http://stackoverflow.com/questions/19205057/how-to-fix-corrupt-hadoop-hdfs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 17:28:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153576#M20540</guid>
      <dc:creator>kgopal</dc:creator>
      <dc:date>2016-02-23T17:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153577#M20541</link>
      <description>&lt;P&gt;You can try to recover some missing blocks by making sure that all your Data nodes and all disks on them
are healthy and running. If they are, and you still have missing blocks the only way out is to delete files with missing blocks,
either one by one or all of them at once using the "fsck &amp;lt;path&amp;gt; -delete" command. &lt;/P&gt;&lt;P&gt;Regarding under replicated blocks, HDFS is suppose to recover them automatically (by creating missing copies to fulfill the replication factor).
If after a few days it doesn't, you can trigger the recovery by running the balancer, or as mentioned in another answer run the "setrep" command.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 18:03:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153577#M20541</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-02-23T18:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153578#M20542</link>
      <description>&lt;DIV&gt;Some more steps&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;get the full details of the files which are causing your problem using hdfs fsck / -files -blocks -locations&lt;/LI&gt;&lt;LI&gt;if it is not replicating on your own run a balancer&lt;/LI&gt;&lt;LI&gt;if you are SURE these files are not needed and would like to just eliminate the error, you can run this command to automatically delete the corrupted files hdfs fsck / -delete
&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 23 Feb 2016 18:40:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153578#M20542</guid>
      <dc:creator>pankaj_singh</dc:creator>
      <dc:date>2016-02-23T18:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153579#M20543</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/2766/sinhapranshu.html"&gt;Pranshu Pranshu&lt;/A&gt;, You have 2 options ...Another &lt;A href="http://centoshowtos.org/hadoop/fix-corrupt-blocks-on-hdfs/"&gt;link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;"The next step would be to determine the importance of the file, can it just be removed and copied back into place, or is there sensitive data that needs to be regenerated?&lt;/P&gt;&lt;P&gt;If it's easy enough just to replace the file, that's the route I would take."&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 20:39:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153579#M20543</guid>
      <dc:creator>rushikeshdeshmu</dc:creator>
      <dc:date>2016-02-23T20:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153580#M20544</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/2766/sinhapranshu.html"&gt;Pranshu Pranshu&lt;/A&gt;, If the original question is answered then please accept the best answer.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 22:46:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153580#M20544</guid>
      <dc:creator>rushikeshdeshmu</dc:creator>
      <dc:date>2016-02-23T22:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153581#M20545</link>
      <description>&lt;P&gt;It seems like, the replication factor is 1 my case. How to get it recovered from DR cluster. ?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 17:26:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153581#M20545</guid>
      <dc:creator>sinha_pranshu</dc:creator>
      <dc:date>2016-02-24T17:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153582#M20546</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/2766/sinhapranshu.html"&gt;Pranshu Pranshu&lt;/A&gt;, You can use "setrep" command for setting replication factor for files and directories:&lt;/P&gt;&lt;H2&gt;setrep&lt;/H2&gt;&lt;P&gt;Usage: hadoop fs -setrep [-R] [-w] &amp;lt;numReplicas&amp;gt; &amp;lt;path&amp;gt;&lt;/P&gt;&lt;P&gt;Changes the replication factor of a file. If &lt;EM&gt;path&lt;/EM&gt; is a directory then the command recursively changes the replication factor of all files under the directory tree rooted at &lt;EM&gt;path&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Options:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;The -w flag requests that the command wait for the replication to complete. This can potentially take a very long time.&lt;/LI&gt;&lt;LI&gt;The -R flag is accepted for backwards compatibility. It has no effect.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;To set replication of an individual file to 3, you can use below command:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;./bin/hadoop dfs -setrep -w 3 /path/to/file&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;You can also do this recursively. To change replication of entire HDFS to 3, you can use below command:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;./bin/hadoop dfs -setrep -R -w 3 /&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Exit Code:&lt;/P&gt;&lt;P&gt;Returns 0 on success and -1 on error.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Hope this helps you to solve this problem?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 17:58:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153582#M20546</guid>
      <dc:creator>rushikeshdeshmu</dc:creator>
      <dc:date>2016-02-24T17:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and under replicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153583#M20547</link>
      <description>&lt;P&gt;I have a similar problem with a filesystem/namenode is safemode because of underreplicated blocks.  My problem is that the "hdfs dfs -setrep -w 3 /path/to/file" fails because the filesystem is in safemode.  If I am in safemode because of underreplicated blocks and the command to fix that doesn't work if you're in safemode, what can you do?&lt;/P&gt;&lt;P&gt;I've tried the command to leave safemode and it seems to work, but it goes back into safemode within a VERY short time.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 05:51:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-under-replicated-blocks/m-p/153583#M20547</guid>
      <dc:creator>hoyenga</dc:creator>
      <dc:date>2017-11-10T05:51:00Z</dc:date>
    </item>
  </channel>
</rss>

