Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-682

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

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None

      Description

      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);
      }

        Attachments

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment