FAQ
hadoop namenode -format doesnt work anymore if target directory doesnt exist
----------------------------------------------------------------------------

Key: HADOOP-682
URL: http://issues.apache.org/jira/browse/HADOOP-682
Project: Hadoop
Issue Type: Bug
Components: dfs
Reporter: Sanjay Dahiya


Not sure if this was intended, but hadoop namenode -format doesnt work anymore if the target directory doesnt exist due to the check in the NameNode.main(). It used to work earlier

if (argv.length == 1 && argv[0].equals("-format")) {
boolean aborted = false;
File[] dirs = getDirs(conf);
for (int idx = 0; idx < dirs.length; idx++) {
if (dirs[idx].exists()) { <<<====== if dir doesnt exist it won't format
System.err.print("Re-format filesystem in " + dirs[idx] +" ? (Y or N) ");
if (!(System.in.read() == 'Y')) {
System.err.println("Format aborted in "+ dirs[idx]);
aborted = true;
} else {
format(dirs[idx]);
System.err.println("Formatted "+dirs[idx]);
}
System.in.read(); // discard the enter-key
}
}
System.exit(aborted ? 1 : 0);
}




--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

Search Discussions

  • Sanjay Dahiya (JIRA) at Nov 6, 2006 at 2:51 pm
    [ http://issues.apache.org/jira/browse/HADOOP-682?page=all ]

    Sanjay Dahiya updated HADOOP-682:
    ---------------------------------

    Attachment: Hadoop-682.patch

    This patch fixes the issue but formatting the namenode if the dir doesn't exist.
    hadoop namenode -format doesnt work anymore if target directory doesnt exist
    ----------------------------------------------------------------------------

    Key: HADOOP-682
    URL: http://issues.apache.org/jira/browse/HADOOP-682
    Project: Hadoop
    Issue Type: Bug
    Components: dfs
    Reporter: Sanjay Dahiya
    Attachments: Hadoop-682.patch


    Not sure if this was intended, but hadoop namenode -format doesnt work anymore if the target directory doesnt exist due to the check in the NameNode.main(). It used to work earlier
    if (argv.length == 1 && argv[0].equals("-format")) {
    boolean aborted = false;
    File[] dirs = getDirs(conf);
    for (int idx = 0; idx < dirs.length; idx++) {
    if (dirs[idx].exists()) { <<<====== if dir doesnt exist it won't format
    System.err.print("Re-format filesystem in " + dirs[idx] +" ? (Y or N) ");
    if (!(System.in.read() == 'Y')) {
    System.err.println("Format aborted in "+ dirs[idx]);
    aborted = true;
    } else {
    format(dirs[idx]);
    System.err.println("Formatted "+dirs[idx]);
    }
    System.in.read(); // discard the enter-key
    }
    }
    System.exit(aborted ? 1 : 0);
    }
    --
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Sanjay Dahiya (JIRA) at Nov 6, 2006 at 2:53 pm
    [ http://issues.apache.org/jira/browse/HADOOP-682?page=all ]

    Sanjay Dahiya updated HADOOP-682:
    ---------------------------------

    Status: Patch Available (was: Open)
    hadoop namenode -format doesnt work anymore if target directory doesnt exist
    ----------------------------------------------------------------------------

    Key: HADOOP-682
    URL: http://issues.apache.org/jira/browse/HADOOP-682
    Project: Hadoop
    Issue Type: Bug
    Components: dfs
    Reporter: Sanjay Dahiya
    Attachments: Hadoop-682.patch


    Not sure if this was intended, but hadoop namenode -format doesnt work anymore if the target directory doesnt exist due to the check in the NameNode.main(). It used to work earlier
    if (argv.length == 1 && argv[0].equals("-format")) {
    boolean aborted = false;
    File[] dirs = getDirs(conf);
    for (int idx = 0; idx < dirs.length; idx++) {
    if (dirs[idx].exists()) { <<<====== if dir doesnt exist it won't format
    System.err.print("Re-format filesystem in " + dirs[idx] +" ? (Y or N) ");
    if (!(System.in.read() == 'Y')) {
    System.err.println("Format aborted in "+ dirs[idx]);
    aborted = true;
    } else {
    format(dirs[idx]);
    System.err.println("Formatted "+dirs[idx]);
    }
    System.in.read(); // discard the enter-key
    }
    }
    System.exit(aborted ? 1 : 0);
    }
    --
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Doug Cutting (JIRA) at Nov 7, 2006 at 7:23 pm
    [ http://issues.apache.org/jira/browse/HADOOP-682?page=all ]

    Doug Cutting updated HADOOP-682:
    --------------------------------

    Status: Resolved (was: Patch Available)
    Fix Version/s: 0.9.0
    Resolution: Fixed

    I just committed this. Thanks, Sanjay!
    hadoop namenode -format doesnt work anymore if target directory doesnt exist
    ----------------------------------------------------------------------------

    Key: HADOOP-682
    URL: http://issues.apache.org/jira/browse/HADOOP-682
    Project: Hadoop
    Issue Type: Bug
    Components: dfs
    Reporter: Sanjay Dahiya
    Fix For: 0.9.0

    Attachments: Hadoop-682.patch


    Not sure if this was intended, but hadoop namenode -format doesnt work anymore if the target directory doesnt exist due to the check in the NameNode.main(). It used to work earlier
    if (argv.length == 1 && argv[0].equals("-format")) {
    boolean aborted = false;
    File[] dirs = getDirs(conf);
    for (int idx = 0; idx < dirs.length; idx++) {
    if (dirs[idx].exists()) { <<<====== if dir doesnt exist it won't format
    System.err.print("Re-format filesystem in " + dirs[idx] +" ? (Y or N) ");
    if (!(System.in.read() == 'Y')) {
    System.err.println("Format aborted in "+ dirs[idx]);
    aborted = true;
    } else {
    format(dirs[idx]);
    System.err.println("Formatted "+dirs[idx]);
    }
    System.in.read(); // discard the enter-key
    }
    }
    System.exit(aborted ? 1 : 0);
    }
    --
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see: http://www.atlassian.com/software/jira

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedNov 6, '06 at 2:49p
activeNov 7, '06 at 7:23p
posts4
users1
websitehadoop.apache.org...
irc#hadoop

1 user in discussion

Doug Cutting (JIRA): 4 posts

People

Translate

site design / logo © 2022 Grokbase