- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How can one increase replication factor to a desired value in Hadoop?
- Labels:
-
Apache Hadoop
-
Apache Hive
Created ‎11-22-2018 07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In hadoop how one can increase replication factor to a desired value?
Created ‎11-22-2018 07:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The replication factor is a property that can be set in the HDFS configuration file( hdfs-site.xml).This will be to set global replication factor for the entire cluster.This will only work on the newly created files but not on the existing files. The Replication factor default value is 3, however for cluster in Pseudo distributed mode its 1.The replication factor value is configurable in hdfs-site.xml file.You have to change dfs.replication to a desired value.
This file is usually found in the conf folder of the Hadoop installation directory.
<property>
<name>dfs.replication</name>
<value>(desired value)</value>
</property>
Change the replication factor on a per-file basis :
hadoop fs –setrep –w 3 /file/filename.xml
-setrep commnad to change the replication factor for files that already exist in HDFS.-R flag would recursively change the replication factor on all the files
eg:
hadoop fs –setrep –w 3 -R /directory/dir.xml
Created ‎12-04-2019 10:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do I need to put the namenode in safe mode to execute this command? or I can execute this on live cluster?
hadoop fs –setrep –w 3 -R /
