How to change the replication factor of specific directory in Hadoop

0 votes
I know that the default replication factor of Hadoop is 3. But I have a file which is very important, so I want to change the replication factor of the directory where I am placing the file. Is it possible to change the replication factor of a directory?
May 10, 2018 in Big Data Hadoop by vardy_hero
1,641 views

1 answer to this question.

0 votes

Yes, you can change the replication factor of the file as well as the directory. Use the below commands:

hdfs dfs –setrep –w 4 /dir/file.txt 
hdfs dfs -setrep -R 4 /dir

But the important thing to keep in mind is altering the replication factor will only change the replication of the file which is already present. But the new file will be created by the default replication.

answered May 10, 2018 by Shubham
• 13,460 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to change the default replication factor in Hadoop?

Hi@akhtar, You can change the default replication factor from the ...READ MORE

answered Oct 2, 2020 in Big Data Hadoop by MD
• 94,990 points
117 views
0 votes
1 answer

Hadoop Hive: How to skip the first line of csv while loading in hive table?

You can try this: CREATE TABLE temp ...READ MORE

answered Nov 8, 2018 in Big Data Hadoop by Omkar
• 69,130 points
4,490 views
0 votes
1 answer

How to check the size of a file in Hadoop HDFS?

You can use the  hadoop fs -ls command to ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Omkar
• 69,130 points
3,639 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
6,652 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
45,477 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
2,514 views
0 votes
1 answer
0 votes
1 answer

How to change the checkpointing duration in Hadoop

Answer: The default duration of checkpointing is 3600 ...READ MORE

answered May 11, 2018 in Big Data Hadoop by Shubham
• 13,460 points
359 views
0 votes
11 answers