Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
0.8.0
-
None
-
None
-
Linux CentOS 4
Description
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'))
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.exit(aborted ? 1 : 0);
}