hadoophdfsfsck

Hadoop fsck shows missing replicas


I am running Hadoop 2.2.0 cluster with two datanodes and one namenode. When I try checking the system using hadoop fsck command on namenode or any of the datanodes, I get the following:

Target Replicas is 3 but found 2 replica(s). 

I tried changing the configuration in hdfs-site.xml (dfs.replication to 2 ) and restarted the cluster services. On running hadoop fsck / it is still showing the same status:

Target Replicas is 3 but found 2 replica(s).

Please clarify, is this a caching issue or a bug?


Solution

  • By setting dfs.replication does not bring down your replication. this property will be referred only when a files is created whose replication is not specified. For changing the replication following hadoop utility could be used

    hadoop fs -setrep [-R] [-w] <rep> <path/file>

    or

    hdfs dfs -setrep [-R] [-w] <rep> <path/file>

    Here / also can be specified for changing the replication factor of the complete filesystem.