The hdfs-site.xml file is used to configure HDFS. Changing the dfs.replication property in hdfs-site.xml will change the default replication for all the files placed in HDFS.
The replication factor on a per-file basis can also be modified by using the following:
Hadoop FS Shell:[training@localhost ~]$ hadoopfs –setrep –w 3 /my/fileConversely,
The replication factor of all the files under a directory can also be changed.
[training@localhost ~]$ hadoopfs –setrep –w 3 -R /my/dir
Learn more about Hadoop from this Big Data Hadoop Training in New York to get ahead in your career!