HDFS Replication – a quick demo

Hi BigD,

I want to share with you a quick demo of replication. Let’s open the DFS health page first.

hadoop021 - replication
3 is the default replication factor for production clusters

So the content will be replicated 3 times. This can be overridden in /opt/hadoop/etc/hadoop/hdfs-site.xml as given below.

<property>
<name>dfs.replication</name>
<value>1</value>
</property>

Let’s make it as 1, using CLI.

hadoop@gandhari:~$ hadoop dfs -setrep -w 1 /data
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Replication 1 set: /data
Waiting for /data ... done
hadoop022 - replication
After changing the replication factor

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top