使用 centos 6.4_64 位错误在 hadoop 2.5.2 上格式化名称节点

Format namenode on hadoop 2.5.2 with centos 6.4_64 bits ERROR

请帮我解决错误:

我在使用 apache hadoop 2.5.2 时 运行 命令 hdfs namenode -format 错误如下:

STARTUP_MSG:   build = https://git-wip-us.apache.org/repos  /asf/hadoop.git -r cc72e9b000545b86b75a61f4835eb86d57bfafc0; compiled by 'jenkins' on 2014-11-14T23:45Z
STARTUP_MSG:   java = 1.7.0_79
************************************************************/
15/05/22 17:19:24 INFO namenode.NameNode: registered UNIX signal    handlers for [TERM, HUP, INT]
15/05/22 17:19:24 INFO namenode.NameNode: createNameNode [-format]
15/05/22 17:19:24 FATAL namenode.NameNode: Exception in namenode join
java.lang.NoClassDefFoundError: org/apache/commons/configuration/Configuration
    at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<init>(DefaultMetricsSystem.java:38)
    at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<clinit>(DefaultMetricsSystem.java:36)
    at org.apache.hadoop.security.UserGroupInformation$UgiMetrics.create(UserGroupInformation.java:108)
    at org.apache.hadoop.security.UserGroupInformation.<clinit>(UserGroupInformation.java:210)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:895)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1354)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1473)
Caused by: java.lang.ClassNotFoundException:    org.apache.commons.configuration.Configuration
    at java.net.URLClassLoader.run(URLClassLoader.java:366)
    at java.net.URLClassLoader.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 7 more
 15/05/22 17:19:24 INFO util.ExitUtil: Exiting with status 1
 15/05/22 17:19:24 INFO namenode.NameNode: SHUTDOWN_MSG:
 /************************************************************
 SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
 ************************************************************/

提前致谢!

你不是第一个遇到this issue的人。
这是因为 hadoop-common-*.jar 必须包含在 org.apache.commons.configuration.Configuration class 中。请参考我粘贴的link将jar作为依赖项,thx。