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
811 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,350 points

Related Questions In Big Data Hadoop

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
• 68,480 points
1,292 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
• 68,480 points
1,196 views
0 votes
1 answer

How to get absolute path of files in a directory in Hadoop?

You can use HDFS API like the ...READ MORE

answered Dec 4, 2018 in Big Data Hadoop by Frankie
• 9,810 points
726 views
0 votes
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
• 10,800 points
3,561 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
18,311 views
0 votes
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,280 points
1,325 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,350 points
122 views
0 votes
11 answers