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 11, 2018 in Big Data Hadoop by vardy_hero
3,402 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 11, 2018 by Shubham
• 13,490 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 3, 2020 in Big Data Hadoop by MD
• 95,440 points
1,484 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,210 points
8,449 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,210 points
12,751 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
10,611 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
104,860 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
4,290 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,490 points
1,221 views
0 votes
11 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP