<?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 underreplicated blocks? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/56919#M3242</link>
    <description>&lt;P&gt;You mentioned that you still need to fix the 'Under-Replicated Blocks'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I found with google to fix:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;$ su &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;$hdfs_user&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;$ hdfs fsck &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;|&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; grep &lt;/SPAN&gt;&lt;SPAN class="str"&gt;'Under replicated'&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;|&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; awk &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;F&lt;/SPAN&gt;&lt;SPAN class="str"&gt;':'&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'{print $1}'&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="str"&gt;/tmp/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;under_replicated_files &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;$ &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;for&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; hdfsfile &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;in&lt;/SPAN&gt; &lt;SPAN class="str"&gt;`cat /tmp/under_replicated_files`&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;do&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; echo &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"Fixing $hdfsfile :"&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; hadoop fs &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;setrep &lt;/SPAN&gt;&lt;SPAN class="lit"&gt;3&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; $hdfsfile&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;done&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2017 19:54:17 GMT</pubDate>
    <dc:creator>rampo</dc:creator>
    <dc:date>2017-07-04T19:54:17Z</dc:date>
    <item>
      <title>How to fix missing and underreplicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/20020#M3237</link>
      <description>&lt;P&gt;In my HDFS status summary in Cloudera Manager, I see the followign messages about missing and underreplicated blocks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;"2 missing blocks in the cluster. 8,062 total blocks in the cluster. Percentage missing blocks: 0.02%. Critical threshold: any."&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;"6,498 under replicated blocks in the cluster. 8,062 total blocks in the cluster. Percentage under replicated blocks: 80.60%. Critical threshold: 40.00%."&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;The 2 corrupt files are the following:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;hdfs@sandy-quad-1:~$ hdfs fsck -list-corruptfileblocks
14/10/10 16:51:59 WARN ssl.FileBasedKeyStoresFactory: The property 'ssl.client.truststore.location' has not been set, no TrustStore will be loaded
Connecting to namenode via &lt;A href="http://sandy-quad-1.sslab.lan:50070" target="_blank"&gt;http://sandy-quad-1.sslab.lan:50070&lt;/A&gt;
The list of corrupt files under path '/' are:
blk_1074173133 /user/history/done/2014/10/07/000001/job_1412322902461_1076-1412674739294-bart-hadoop%2Dmapreduce%2Dclient%2Djobclient%2D2.3.0%2Dcdh5.1.2%2Dt-1412674771395-10-1-SUCCEEDED-root.bart-1412674749886.jhist
blk_1074173134 /user/history/done/2014/10/07/000001/job_1412322902461_1076_conf.xml
The filesystem under path '/' has 2 CORRUPT files&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;What is the best way to fix these two corrupt files and also fix the underreplicated block problem?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2014 14:59:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/20020#M3237</guid>
      <dc:creator>Bart Vandewoestyne</dc:creator>
      <dc:date>2014-10-10T14:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and underreplicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/20024#M3238</link>
      <description>&lt;P&gt;I was able to remove the corrupt files using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;hdfs@sandy-quad-1:~$ hdfs fsck / -delete&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Now I still need to find out how to fix the 'Under-Replicated Blocks' problem...&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2014 15:09:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/20024#M3238</guid>
      <dc:creator>Bart Vandewoestyne</dc:creator>
      <dc:date>2014-10-10T15:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and underreplicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/20560#M3239</link>
      <description>There are different ways you can avoid this problem depending on your data blocks..&lt;BR /&gt;1) if you have a data under-replicated it should just automatically replicate the blocks to other data nodes to match the replication factor&lt;BR /&gt;2) if it is not replicating on your own run a balancer&lt;BR /&gt;3) you can also set replication on a specific file which is under replicated&lt;BR /&gt;4) if it is just a temp file which is created while running the job when your speculative execution tasks are high, make the speculative execution tasks nearly match the replication factor so that it wouldn't complain about the temp files after the job run.</description>
      <pubDate>Mon, 20 Oct 2014 20:51:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/20560#M3239</guid>
      <dc:creator>Manikumar Juttukonda</dc:creator>
      <dc:date>2014-10-20T20:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and underreplicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/33197#M3240</link>
      <description>&lt;P&gt;van you please explain in detail&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 04:52:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/33197#M3240</guid>
      <dc:creator>RamSadineni</dc:creator>
      <dc:date>2015-10-21T04:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and underreplicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/46111#M3241</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Providing some additional detail information for later reference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Manikumar's notes above only pertain to under replicated blocks, and not to missing blocks as the original problem statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Missing blocks are ones&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;where the Namenode determines that _all_ copies of the blocks are missing from the environment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;While under replicated blocks are&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;when the Namenode determines that some of the copies of the blocks are missing from the environment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;As mentioned above, the under replicated blocks should be automatically recovered by HDFS.&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;The Namenode coordinates the increase in replication for a block through the Datanodes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Under replicated blocks often occur with hardware failure, and it can take some amount of time to replicate all of the blocks to another disk, or Datanode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;There are a couple of methods to monitor under replicated blocks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;1)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;For clusters with Cloudera Manager installed:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Click on the "Charts" link at the top of the screen&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Click on "Chart Builder"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;use the following query:&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;"select under_replicated_blocks;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;This will display a plot over time of the under replicated blocks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;If this value is decreasing, just continue to monitor the value until it drops to 0, and make sure that all Datanodes are healthy and available.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;2)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;For clusters without Cloudera Manager&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;The Namenode tracks the under replicated blocks through it's web ui in two ways:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://namenode.example.com:50070/dfshealth.html#tab-overview" target="_blank"&gt;http://namenode.example.com:50070/dfshealth.html#tab-overview&lt;/A&gt; and look for "Under-Replicated" or&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://namenode.example.com:50070/jmx" target="_blank"&gt;http://namenode.example.com:50070/jmx&lt;/A&gt; and look for "UnderReplicatedBlocks"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;* The ports and locations will change for your cluster.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Running a balancer, will not change replication of blocks.&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;The Namenode will ask Datanodes to transfer blocks based upon the average disk utilization of the cluster&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;compared to the average disk utilization of the node.&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;The balancer is typically limited in throughput to enable balancing as a background task, while normal recovery of&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;under replicated blocks happens at an unrestricted rate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;If the under replicated blocks are not decreasing, but staying steady, then more investigation is necessary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Here are some questions to ask:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Is this a small cluster? ( 3 nodes, under 10 ).&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;If so:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;-&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Is the default replication greater than the number of alive Datanodes?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;-&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Is the value of mapreduce.client.submit.file.replication lower than the number of Datanodes configured?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;When a mapreduce job runs, it will attempt to ensure that files are copied to the cluster with mapreduce.client.submit.file.replication copies.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;If this is larger than the number of nodes that you have in the cluster, then you will always have under replicated blocks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Is the cluster larger? if so:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;- Is the network unhealthy?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;If the Datanodes are frequently out of touch with the cluster, then the Namenode may be marking blocks as wrongly under replicated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://namenode.example.com:50070/dfshealth.html#tab-datanode" target="_blank"&gt;http://namenode.example.com:50070/dfshealth.html#tab-datanode&lt;/A&gt; will have information regarding last time that the Namenode was contacted by the Datanode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Work with your networking team to validate the environment, and make sure that any top of rack switches or any other networking hardware is healthy and not over subscribed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;- Are there racks configured in the cluster?&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Is one rack entirely down?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;This will cause under replicated blocks that might be impossible to resolve.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;HDFS will not store all three block replicas within one rack.&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;If you have only two racks, and one is down, then under replication will be impossible to resolve until the rack is healthy again.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Is the problem limited to specific files?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;The default replication configured through Cloudera Manager, or through hdfs-site.xml in non-Cloudera Manager installations only determines the default.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Individual users are able to change replication when any file is created.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;This is unusual, but may happen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;The following command will show all files that are not open.&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Look for "Target Replicas is&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;X but found Y replica(s)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;hdfs fsck / -files&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;If X is larger than the number of available nodes, or different than the default replication, then you will be able to change the replication of that file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;hdfs dfs -setrep 3 /path/to/strangefile&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;( Also note that "hdfs dfs -ls -R /" &lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;will show desired replication for a file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Also "hdfs fsck / -blocks -files -locations" provides a very detailed view of all of the blocks of your cluster.&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Any of these commands may take a long time in a large cluster. )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 15:31:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/46111#M3241</guid>
      <dc:creator>Caseydilla</dc:creator>
      <dc:date>2016-10-10T15:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix missing and underreplicated blocks?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/56919#M3242</link>
      <description>&lt;P&gt;You mentioned that you still need to fix the 'Under-Replicated Blocks'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I found with google to fix:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;$ su &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;$hdfs_user&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;$ hdfs fsck &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;|&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; grep &lt;/SPAN&gt;&lt;SPAN class="str"&gt;'Under replicated'&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;|&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; awk &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;F&lt;/SPAN&gt;&lt;SPAN class="str"&gt;':'&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'{print $1}'&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="str"&gt;/tmp/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;under_replicated_files &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;$ &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;for&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; hdfsfile &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;in&lt;/SPAN&gt; &lt;SPAN class="str"&gt;`cat /tmp/under_replicated_files`&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;do&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; echo &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"Fixing $hdfsfile :"&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; hadoop fs &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;setrep &lt;/SPAN&gt;&lt;SPAN class="lit"&gt;3&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; $hdfsfile&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;done&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 19:54:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-fix-missing-and-underreplicated-blocks/m-p/56919#M3242</guid>
      <dc:creator>rampo</dc:creator>
      <dc:date>2017-07-04T19:54:17Z</dc:date>
    </item>
  </channel>
</rss>

