Carl Sagan
Carl Sagan

Reputation: 982

HDFS - How to force replication factor

The replication factor used to be set to 3, but is now 1. How do I force the replication factor to the cluster? In other words, initiate a process to delete now over-replicated file blocks?

Upvotes: 1

Views: 2782

Answers (1)

SSaikia_JtheRocker
SSaikia_JtheRocker

Reputation: 5063

It's better if you allow it to happen automtically overtime but If you want to force the new replication factor to be effective quickly, may be you could run the balancer script using,

$HADOOP_HOME/bin/start-balancer.sh

This should re-balance the blocks across the cluster.

Or, you can probably do this for the existing files,

hadoop fs -setrep -R 1 /

, which will probably set the replication levels of files recursively inside /

Upvotes: 4

Related Questions