0 votes
in Big Data | Hadoop by
What is Replication factor in HDFS, and how can we set it?

1 Answer

0 votes
by

Replication factor in HDFS is the number of copies of a file in file system. A Hadoop application can specify the number of replicas of a file it wants HDFS to maintain.

This information is stored in NameNode.

We can set the replication factor in following ways:

 

We can use Hadoop fs shell, to specify the replication factor for a file. Command as follows:

$hadoop fs –setrep –w 5

/file_name

In above command, replication factor of file_name file is set as 5.

We can also use Hadoop fs shell, to specify the replication factor of all the files in a directory.

$hadoop fs –setrep –w 2

/dir_name

 

In above command, replication factor of all the files under directory dir_name is set as 2.

 

Related questions

0 votes
asked Jan 11, 2020 in Big Data | Hadoop by rajeshsharma
0 votes
asked Jan 12, 2020 in Big Data | Hadoop by sharadyadav1986
...