1.

How can you overwrite the replication factors in HDFS ?

Answer»

 The replication factor in HDFS can be modified /overwritten in 2 ways-

  • Using the Hadoop FS SHELL, replication factor can be changed per file basis using the below command
$hadoop fs –setrep –w 2 /my/sample.xml

 sample.xml is the filename WHOSE replication factor will be set to 2

  • Using the Hadoop FS Shell, replication factor of all files under a given DIRECTORY can be modified using the below command-
$hadoop fs –setrep –w 6 /my/sample_dir

sample_dir is the name of the directory and all the files in this directory will have a replication factor set to 6.



Discussion

No Comment Found

Related InterviewSolutions