[ http://issues.apache.org/jira/browse/HADOOP-714?page=all ]

Milind Bhandarkar resolved HADOOP-714.
--------------------------------------

    Fix Version/s: 0.9.0
       Resolution: Duplicate

http://issues.apache.org/jira/browse/HADOOP-682

> Namenode format does not work when hadoop is installed for first time
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-714
>                 URL: http://issues.apache.org/jira/browse/HADOOP-714
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.8.0
>         Environment: Linux CentOS 4
>            Reporter: Lei Chen
>             Fix For: 0.9.0
>
>
> The namenode can not be formatted for the first time installation. There is a 
> bug is the main function of org.apache.hadoop.dfs.NameNode class. The code 
> will skip formatting when the directory for name does not exist. There is a 
> possible fix for the bug
>                       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()) {
>                                               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 {
>                                                       System.out.println("do 
> format"
>                                                                       + 
> dirs[idx].getAbsolutePath());
>                                                       format(dirs[idx]);
>                                                       
> System.err.println("Formatted " + dirs[idx]);
>                                               }
>                                               System.in.read(); // discard 
> the enter-key
>                                       } else {
>                                               System.out.println("do format"
>                                                               + 
> dirs[idx].getAbsolutePath());
>                                               format(dirs[idx]);
>                                               System.err.println("Formatted " 
> + dirs[idx]);
>                                       }
>                               }
>                               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

        

Reply via email to