又回来看HDFS 1.2.1 版本了,首先要执行hadoop namenode -format
---
执行脚本./hadoop namenode -format 后,脚本最后执行的核心部分是:
exec "$JAVA" -Dproc_$COMMAND $JAVA_HEAP_MAX $HADOOP_OPTS -classpath "$CLASSPATH" $CLASS "[email protected]"
打印出内容就是
/usr/java/jdk1.8.0_45/bin/java -Dproc_namenode -Xmx1000m -Dcom.sun.management.jmxremote -Dhadoop.log.dir=/root/hadoop-1.2.1/libexec/../logs -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/root/hadoop-1.2.1/libexec/.. -Dhadoop.id.str= -Dhadoop.root.logger=INFO,console -Dhadoop.security.logger=INFO,DRFAS -Djava.library.path=/root/hadoop-1.2.1/libexec/../lib/native/Linux-i386-32 -Dhadoop.policy.file=hadoop-policy.xml -classpath /root/hadoop-1.2.1/libexec/../conf:/usr/java/jdk1.8.0_45/lib/tools.jar:/root/hadoop-1.2.1/libexec/..:/root/hadoop-1.2.1/libexec/../hadoop-core-1.2.1.jar:/root/hadoop-1.2.1/libexec/../lib/asm-3.2.jar:/root/hadoop-1.2.1/libexec/../lib/aspectjrt-1.6.11.jar:/root/hadoop-1.2.1/libexec/../lib/aspectjtools-1.6.11.jar:/root/hadoop-1.2.1/libexec/../lib/commons-beanutils-1.7.0.jar:/root/hadoop-1.2.1/libexec/../lib/commons-beanutils-core-1.8.0.jar:/root/hadoop-1.2.1/libexec/../lib/commons-cli-1.2.jar:/root/hadoop-1.2.1/libexec/../lib/commons-codec-1.4.jar:/root/hadoop-1.2.1/libexec/../lib/commons-collections-3.2.1.jar:/root/hadoop-1.2.1/libexec/../lib/commons-configuration-1.6.jar:/root/hadoop-1.2.1/libexec/../lib/commons-daemon-1.0.1.jar:/root/hadoop-1.2.1/libexec/../lib/commons-digester-1.8.jar:/root/hadoop-1.2.1/libexec/../lib/commons-el-1.0.jar:/root/hadoop-1.2.1/libexec/../lib/commons-httpclient-3.0.1.jar:/root/hadoop-1.2.1/libexec/../lib/commons-io-2.1.jar:/root/hadoop-1.2.1/libexec/../lib/commons-lang-2.4.jar:/root/hadoop-1.2.1/libexec/../lib/commons-logging-1.1.1.jar:/root/hadoop-1.2.1/libexec/../lib/commons-logging-api-1.0.4.jar:/root/hadoop-1.2.1/libexec/../lib/commons-math-2.1.jar:/root/hadoop-1.2.1/libexec/../lib/commons-net-3.1.jar:/root/hadoop-1.2.1/libexec/../lib/core-3.1.1.jar:/root/hadoop-1.2.1/libexec/../lib/hadoop-capacity-scheduler-1.2.1.jar:/root/hadoop-1.2.1/libexec/../lib/hadoop-fairscheduler-1.2.1.jar:/root/hadoop-1.2.1/libexec/../lib/hadoop-thriftfs-1.2.1.jar:/root/hadoop-1.2.1/libexec/../lib/hsqldb-1.8.0.10.jar:/root/hadoop-1.2.1/libexec/../lib/jackson-core-asl-1.8.8.jar:/root/hadoop-1.2.1/libexec/../lib/jackson-mapper-asl-1.8.8.jar:/root/hadoop-1.2.1/libexec/../lib/jasper-compiler-5.5.12.jar:/root/hadoop-1.2.1/libexec/../lib/jasper-runtime-5.5.12.jar:/root/hadoop-1.2.1/libexec/../lib/jdeb-0.8.jar:/root/hadoop-1.2.1/libexec/../lib/jersey-core-1.8.jar:/root/hadoop-1.2.1/libexec/../lib/jersey-json-1.8.jar:/root/hadoop-1.2.1/libexec/../lib/jersey-server-1.8.jar:/root/hadoop-1.2.1/libexec/../lib/jets3t-0.6.1.jar:/root/hadoop-1.2.1/libexec/../lib/jetty-6.1.26.jar:/root/hadoop-1.2.1/libexec/../lib/jetty-util-6.1.26.jar:/root/hadoop-1.2.1/libexec/../lib/jsch-0.1.42.jar:/root/hadoop-1.2.1/libexec/../lib/junit-4.5.jar:/root/hadoop-1.2.1/libexec/../lib/kfs-0.2.2.jar:/root/hadoop-1.2.1/libexec/../lib/log4j-1.2.15.jar:/root/hadoop-1.2.1/libexec/../lib/mockito-all-1.8.5.jar:/root/hadoop-1.2.1/libexec/../lib/oro-2.0.8.jar:/root/hadoop-1.2.1/libexec/../lib/servlet-api-2.5-20081211.jar:/root/hadoop-1.2.1/libexec/../lib/slf4j-api-1.4.3.jar:/root/hadoop-1.2.1/libexec/../lib/slf4j-log4j12-1.4.3.jar:/root/hadoop-1.2.1/libexec/../lib/xmlenc-0.52.jar:/root/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-2.1.jar:/root/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-api-2.1.jar org.apache.hadoop.hdfs.server.namenode.NameNode -format
去掉若干修饰词,最后的核心部分就是
java org.apache.hadoop.hdfs.server.namenode.NameNode -format
下面就来分析NameNode这个类。