5

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?

vefthym
  • 7,422
  • 6
  • 32
  • 58
abbasdjinn
  • 157
  • 4
  • 9

1 Answers1

3

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.

SachinJose
  • 8,462
  • 4
  • 42
  • 63
  • I have transferred files to HDFS without specifying the replication factor and at that time the replication factor was set to 3 but i have changed the replication factor to 2 afterwards. Then i am getting this Target Replicas is 3 but found 2 replica(s). – abbasdjinn Apr 30 '14 at 15:40
  • hadoop fs -setrep [-R] [-w] is the full command also hdfs dfs -setrep [-R] [-w] will work. Details - https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/FileSystemShell.html#setrep – ewm Nov 20 '15 at 17:02
  • Thanks, missed out fs – SachinJose Nov 20 '15 at 21:15