Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hadoop fsck shows missing replicas

Tags:

hadoop

hdfs

fsck

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?

like image 525
abbasdjinn Avatar asked Oct 21 '22 09:10

abbasdjinn


1 Answers

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.

like image 66
SachinJ Avatar answered Oct 23 '22 01:10

SachinJ