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
105 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 12,710 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
• 66,880 points
440 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
• 66,880 points
322 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,710 points
282 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
• 9,310 points
1,820 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
9,002 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,260 points
646 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
• 12,710 points
34 views
0 votes
10 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.