WebHosting

Wednesday, January 2, 2013

Changing Replication factor in hadoop on fly

Changing Replication factor in Hadoop on fly, the may be many time when you need to define replication factor of a specific file or directory on the fly, so following command will help you to change it.

The command used for this is "setrep"

How will you do it?

Solution :

Here are the steps :

Syntax :

  • hadoop dfs -setrep [-R] <path>
    So this will change the replication factor of a file, and the optional [R] will ask to change the replication factor recursively.
    This will return 0, and -1 on failure.

Some Examples of the commnad:
  •     hadoop dfs -setrep -w 2 /home/filename   <---- </home/filename is path of file on hdfs>
If you want to change recursively, of entire hdfs, or directory then you can user following command

    ./bin/hadoop dfs -setrep -R -w 2 /

This will change the replication recursively.

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

เค•िเคธเค•े เคนिเคธ्เคธे เคฎें เคฎें เคฏे เคงเคฐเคคी

เคšिเคก़िเคฏों เค•ा เค˜เคฐ เคœเคฒ เคฐเคนा เคนै  เค‡ंเคธाเคจ เค–ुเคถ เคนै เค•ि เคฏे เค†เค— เคฆूเคฐ เคนै เค…เคญी เค•เคญी เคคो เค†เคเค—ी เค˜เคฐ เคคเค•  เคคेเคฐा เคญी เค˜เคฐ เคœเคฒेเค—ा เค•เคญी เคฌेเคœुเคฌाเคจ เคนै เค•ुเค› เคฌोเคฒเคคे เคจเคนीं เคนै เคฆिเคฒ เคฎें เคฆुเค– ...