https://blog.csdn.net/yitengtongweishi/article/details/81946349
https://blog.csdn.net/yitengtongweishi/article/details/81946083
Hadoop Releases
单击上述链接,下载需要的版本。笔者选择的是 hadoop-2.6.5.tar.gz 和 hadoop-2.6.5.tar.gz.mds。
校验 下载的Hadoop 压缩文件
blockchain@Dao:~$ md5sum Downloads/hadoop-2.6.5.tar.gz
967c24f3c15fcdd058f34923e92ce8ac Downloads/hadoop-2.6.5.tar.gz
blockchain@Dao:~$
blockchain@Dao:~$ cat Downloads/hadoop-2.6.5.tar.gz.mds
hadoop-2.6.5.tar.gz: MD5 = 96 7C 24 F3 C1 5F CD D0 58 F3 49 23 E9 2C E8 AC
hadoop-2.6.5.tar.gz: SHA1 = 877B FD6E 3577 3E4B 9021 53BD BD89 877B F360 5BA4
hadoop-2.6.5.tar.gz: RMD160 = 1F4D 4D66 26D4 ED7F 0F90 45D6 ADF8 5314 6C80 112C
hadoop-2.6.5.tar.gz: SHA224 = F187156E B23AA6D6 6BAD2788 4EB0480C 006732D3
E6EF3033 093750CF
hadoop-2.6.5.tar.gz: SHA256 = 001AD18D 4B6D0FE5 42B15DDA DBA2D092 BC97DF1C
4D2D7973 81C8D128 87691898
hadoop-2.6.5.tar.gz: SHA384 = 9B4B0CAE AD744C17 62660C76 11EEB503 B0F04ED6
6CF54B45 1196D68F 3129369E 04279893 B63A7799
AE45CA9D 3ECE13F9
hadoop-2.6.5.tar.gz: SHA512 = FD9D2415 5BB18475 C25BC6A8 8284A696 224D5EF3
8503C5C3 F1D4C0B6 5AE1C552 D90D2136 CA0FA452
94D62204 EED3D115 4785C12C C260CCA4 2EA2FBF0
27B461B2
blockchain@Dao:~$
校验成功后,解压 Hadoop 压缩文件
blockchain@Dao:~$ tar -zxvf Downloads/hadoop-2.6.5.tar.gz -C ~
修改文件夹属性,避免恼人的权限问题
blockchain@Dao:~$ sudo chown blockchain:blockchain -R /home/blockchain/hadoop-2.6.5/
编辑 ~/.bashrc ,在文件末尾添加
#Hadoop
export HADOOP_HOME=$HOME/hadoop-2.6.5
export PATH=$PATH:${HADOOP_HOME}/bin
使配置立即生效
blockchain@Dao:~$ source ~/.bashrc
切换至 ${HADOOP_HOME}/etc/hadoop 目录,
blockchain@Dao:~/hadoop-2.6.5/etc/hadoop$ cd /home/blockchain/hadoop-2.6.5/etc/hadoop/ ; ls -lt
total 152
-rw-rw-r-- 1 blockchain blockchain 4436 10月 3 2016 capacity-scheduler.xml
-rw-rw-r-- 1 blockchain blockchain 1335 10月 3 2016 configuration.xsl
-rw-rw-r-- 1 blockchain blockchain 318 10月 3 2016 container-executor.cfg
-rw-rw-r-- 1 blockchain blockchain 775 10月 3 2016 hdfs-site.xml
-rw-rw-r-- 1 blockchain blockchain 1449 10月 3 2016 httpfs-env.sh
-rw-rw-r-- 1 blockchain blockchain 1657 10月 3 2016 httpfs-log4j.properties
-rw-rw-r-- 1 blockchain blockchain 21 10月 3 2016 httpfs-signature.secret
-rw-rw-r-- 1 blockchain blockchain 620 10月 3 2016 httpfs-site.xml
-rw-rw-r-- 1 blockchain blockchain 3523 10月 3 2016 kms-acls.xml
-rw-rw-r-- 1 blockchain blockchain 1325 10月 3 2016 kms-env.sh
-rw-rw-r-- 1 blockchain blockchain 1631 10月 3 2016 kms-log4j.properties
-rw-rw-r-- 1 blockchain blockchain 5511 10月 3 2016 kms-site.xml
-rw-rw-r-- 1 blockchain blockchain 938 10月 3 2016 mapred-env.cmd
-rw-rw-r-- 1 blockchain blockchain 1383 10月 3 2016 mapred-env.sh
-rw-rw-r-- 1 blockchain blockchain 4113 10月 3 2016 mapred-queues.xml.template
-rw-rw-r-- 1 blockchain blockchain 758 10月 3 2016 mapred-site.xml.template
-rw-rw-r-- 1 blockchain blockchain 10 10月 3 2016 slaves
-rw-rw-r-- 1 blockchain blockchain 2237 10月 3 2016 yarn-env.cmd
-rw-rw-r-- 1 blockchain blockchain 4567 10月 3 2016 yarn-env.sh
-rw-rw-r-- 1 blockchain blockchain 690 10月 3 2016 yarn-site.xml
-rw-rw-r-- 1 blockchain blockchain 774 10月 3 2016 core-site.xml
-rw-rw-r-- 1 blockchain blockchain 3670 10月 3 2016 hadoop-env.cmd
-rw-rw-r-- 1 blockchain blockchain 4224 10月 3 2016 hadoop-env.sh
-rw-rw-r-- 1 blockchain blockchain 2598 10月 3 2016 hadoop-metrics2.properties
-rw-rw-r-- 1 blockchain blockchain 2490 10月 3 2016 hadoop-metrics.properties
-rw-rw-r-- 1 blockchain blockchain 9683 10月 3 2016 hadoop-policy.xml
-rw-rw-r-- 1 blockchain blockchain 11291 10月 3 2016 log4j.properties
-rw-rw-r-- 1 blockchain blockchain 2316 10月 3 2016 ssl-client.xml.example
-rw-rw-r-- 1 blockchain blockchain 2268 10月 3 2016 ssl-server.xml.example
blockchain@Dao:~/hadoop-2.6.5/etc/hadoop$
修改 hadoop-env.sh 中的部分内容:
# The java implementation to use.
#export JAVA_HOME=${JAVA_HOME}
export JAVA_HOME=${HOME}/jdk1.8.0_181
修改配置文件 core-site.xml,修改后的内容如下:
hadoop.tmp.dir
file:/home/blockchain/hadoop-2.6.5/tmp
Abase for other temporary directories.
fs.defaultFS
hdfs://localhost:9000
修改配置文件 hdfs-site.xml,修改后的内容如下:
dfs.replication
1
dfs.namenode.name.dir
file:/home/blockchain/hadoop-2.6.5/tmp/dfs/name
dfs.datanode.data.dir
file:/home/blockchain/hadoop-2.6.5/tmp/dfs/data
复制 mapred-site.xml.template 为 mapred-site.xml,修改配置文件 mapred-site.xml,修改后的内容如下:
mapreduce.framework.name
yarn
修改配置文件 yarn-site.xml,修改后的内容如下:
yarn.nodemanager.aux-services
mapreduce_shuffle
格式化 NameNode
blockchain@Dao:~/hadoop-2.6.5$ ./bin/hdfs namenode -format
18/08/22 15:03:32 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = Dao/127.0.1.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 2.6.5
STARTUP_MSG: classpath = /home/blockchain/hadoop-2.6.5/etc/hadoop:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jets3t-0.9.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/curator-framework-2.6.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/curator-client-2.6.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/hamcrest-core-1.3.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-net-3.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-codec-1.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-beanutils-1.7.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/mockito-all-1.8.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/guava-11.0.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/asm-3.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jersey-json-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jasper-runtime-5.5.23.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jettison-1.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-compress-1.4.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/activation-1.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jasper-compiler-5.5.23.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/servlet-api-2.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jetty-util-6.1.26.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jersey-core-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/stax-api-1.0-2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/httpclient-4.2.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-io-2.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/avro-1.7.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/hadoop-auth-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/httpcore-4.2.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/log4j-1.2.17.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/zookeeper-3.4.6.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/htrace-core-3.0.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-math3-3.1.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/xmlenc-0.52.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/netty-3.6.2.Final.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/slf4j-api-1.7.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jsp-api-2.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-el-1.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-beanutils-core-1.8.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-digester-1.8.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/gson-2.2.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jetty-6.1.26.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jsr305-1.3.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jersey-server-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/hadoop-annotations-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-logging-1.1.3.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/xz-1.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-lang-2.6.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-cli-1.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-collections-3.2.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/junit-4.11.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-configuration-1.6.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/paranamer-2.3.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/jsch-0.1.42.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/snappy-java-1.0.4.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/curator-recipes-2.6.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/lib/commons-httpclient-3.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/hadoop-common-2.6.5-tests.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/hadoop-common-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/common/hadoop-nfs-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/guava-11.0.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/asm-3.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jasper-runtime-5.5.23.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-io-2.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/xml-apis-1.3.04.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/htrace-core-3.0.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/netty-3.6.2.Final.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jsp-api-2.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-el-1.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jsr305-1.3.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/lib/xercesImpl-2.9.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/hadoop-hdfs-2.6.5-tests.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/hadoop-hdfs-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/hdfs/hadoop-hdfs-nfs-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-codec-1.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/guava-11.0.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/asm-3.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-json-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jettison-1.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-compress-1.4.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/activation-1.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/servlet-api-2.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/javax.inject-1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-core-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/guice-3.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-io-2.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/log4j-1.2.17.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/zookeeper-3.4.6.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/netty-3.6.2.Final.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jetty-6.1.26.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jsr305-1.3.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-server-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/xz-1.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jline-0.9.94.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-lang-2.6.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-cli-1.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-collections-3.2.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jersey-client-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/aopalliance-1.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/lib/commons-httpclient-3.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-api-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-registry-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-common-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-common-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-client-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-tests-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/asm-3.2.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/commons-compress-1.4.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/javax.inject-1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/guice-3.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/avro-1.7.4.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/netty-3.6.2.Final.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/hadoop-annotations-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/xz-1.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/junit-4.11.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/snappy-java-1.0.4.1.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.6.5.jar:/home/blockchain/hadoop-2.6.5/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.5-tests.jar:/home/blockchain/hadoop-2.6.5/contrib/capacity-scheduler/*.jar
STARTUP_MSG: build = https://github.com/apache/hadoop.git -r e8c9fe0b4c252caf2ebf1464220599650f119997; compiled by 'sjlee' on 2016-10-02T23:43Z
STARTUP_MSG: java = 1.8.0_181
************************************************************/
18/08/22 15:03:32 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
18/08/22 15:03:32 INFO namenode.NameNode: createNameNode [-format]
Formatting using clusterid: CID-d056b431-2295-41c3-af5f-af2fbf88bf79
18/08/22 15:03:34 INFO namenode.FSNamesystem: No KeyProvider found.
18/08/22 15:03:34 INFO namenode.FSNamesystem: fsLock is fair:true
18/08/22 15:03:34 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=1000
18/08/22 15:03:34 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
18/08/22 15:03:34 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
18/08/22 15:03:34 INFO blockmanagement.BlockManager: The block deletion will start around 2018 Aug 22 15:03:34
18/08/22 15:03:34 INFO util.GSet: Computing capacity for map BlocksMap
18/08/22 15:03:34 INFO util.GSet: VM type = 64-bit
18/08/22 15:03:34 INFO util.GSet: 2.0% max memory 889 MB = 17.8 MB
18/08/22 15:03:34 INFO util.GSet: capacity = 2^21 = 2097152 entries
18/08/22 15:03:34 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
18/08/22 15:03:34 INFO blockmanagement.BlockManager: defaultReplication = 1
18/08/22 15:03:34 INFO blockmanagement.BlockManager: maxReplication = 512
18/08/22 15:03:34 INFO blockmanagement.BlockManager: minReplication = 1
18/08/22 15:03:34 INFO blockmanagement.BlockManager: maxReplicationStreams = 2
18/08/22 15:03:34 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
18/08/22 15:03:34 INFO blockmanagement.BlockManager: encryptDataTransfer = false
18/08/22 15:03:34 INFO blockmanagement.BlockManager: maxNumBlocksToLog = 1000
18/08/22 15:03:34 INFO namenode.FSNamesystem: fsOwner = blockchain (auth:SIMPLE)
18/08/22 15:03:34 INFO namenode.FSNamesystem: supergroup = supergroup
18/08/22 15:03:34 INFO namenode.FSNamesystem: isPermissionEnabled = true
18/08/22 15:03:34 INFO namenode.FSNamesystem: HA Enabled: false
18/08/22 15:03:34 INFO namenode.FSNamesystem: Append Enabled: true
18/08/22 15:03:35 INFO util.GSet: Computing capacity for map INodeMap
18/08/22 15:03:35 INFO util.GSet: VM type = 64-bit
18/08/22 15:03:35 INFO util.GSet: 1.0% max memory 889 MB = 8.9 MB
18/08/22 15:03:35 INFO util.GSet: capacity = 2^20 = 1048576 entries
18/08/22 15:03:35 INFO namenode.NameNode: Caching file names occuring more than 10 times
18/08/22 15:03:35 INFO util.GSet: Computing capacity for map cachedBlocks
18/08/22 15:03:35 INFO util.GSet: VM type = 64-bit
18/08/22 15:03:35 INFO util.GSet: 0.25% max memory 889 MB = 2.2 MB
18/08/22 15:03:35 INFO util.GSet: capacity = 2^18 = 262144 entries
18/08/22 15:03:35 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
18/08/22 15:03:35 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 0
18/08/22 15:03:35 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension = 30000
18/08/22 15:03:35 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
18/08/22 15:03:35 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
18/08/22 15:03:35 INFO util.GSet: Computing capacity for map NameNodeRetryCache
18/08/22 15:03:35 INFO util.GSet: VM type = 64-bit
18/08/22 15:03:35 INFO util.GSet: 0.029999999329447746% max memory 889 MB = 273.1 KB
18/08/22 15:03:35 INFO util.GSet: capacity = 2^15 = 32768 entries
18/08/22 15:03:35 INFO namenode.NNConf: ACLs enabled? false
18/08/22 15:03:35 INFO namenode.NNConf: XAttrs enabled? true
18/08/22 15:03:35 INFO namenode.NNConf: Maximum size of an xattr: 16384
18/08/22 15:03:35 INFO namenode.FSImage: Allocated new BlockPoolId: BP-2092028299-127.0.1.1-1534921415736
18/08/22 15:03:36 INFO common.Storage: Storage directory /home/blockchain/hadoop-2.6.5/tmp/dfs/name has been successfully formatted.
18/08/22 15:03:36 INFO namenode.FSImageFormatProtobuf: Saving image file /home/blockchain/hadoop-2.6.5/tmp/dfs/name/current/fsimage.ckpt_0000000000000000000 using no compression
18/08/22 15:03:36 INFO namenode.FSImageFormatProtobuf: Image file /home/blockchain/hadoop-2.6.5/tmp/dfs/name/current/fsimage.ckpt_0000000000000000000 of size 327 bytes saved in 0 seconds.
18/08/22 15:03:36 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
18/08/22 15:03:36 INFO util.ExitUtil: Exiting with status 0
18/08/22 15:03:36 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at Dao/127.0.1.1
************************************************************/
blockchain@Dao:~/hadoop-2.6.5$
启动 HDFS
blockchain@Dao:~/hadoop-2.6.5$ ./sbin/start-dfs.sh
Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/blockchain/hadoop-2.6.5/logs/hadoop-blockchain-namenode-Dao.out
localhost: starting datanode, logging to /home/blockchain/hadoop-2.6.5/logs/hadoop-blockchain-datanode-Dao.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/blockchain/hadoop-2.6.5/logs/hadoop-blockchain-secondarynamenode-Dao.out
blockchain@Dao:~/hadoop-2.6.5$ jps
10996 NameNode
11337 SecondaryNameNode
11147 DataNode
11469 Jps
blockchain@Dao:~/hadoop-2.6.5$
启动 YARN
blockchain@Dao:~/hadoop-2.6.5$ ./sbin/start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /home/blockchain/hadoop-2.6.5/logs/yarn-blockchain-resourcemanager-Dao.out
localhost: starting nodemanager, logging to /home/blockchain/hadoop-2.6.5/logs/yarn-blockchain-nodemanager-Dao.out
blockchain@Dao:~/hadoop-2.6.5$ jps
11571 ResourceManager
11700 NodeManager
10996 NameNode
11337 SecondaryNameNode
12009 Jps
11147 DataNode
blockchain@Dao:~/hadoop-2.6.5$
启动历史服务器,才能在网页中查看任务运行情况
blockchain@Dao:~/hadoop-2.6.5$ ./sbin/mr-jobhistory-daemon.sh start historyserver
starting historyserver, logging to /home/blockchain/hadoop-2.6.5/logs/mapred-blockchain-historyserver-Dao.out
blockchain@Dao:~/hadoop-2.6.5$ jps
11571 ResourceManager
11700 NodeManager
10996 NameNode
11337 SecondaryNameNode
11147 DataNode
12075 JobHistoryServer
12126 Jps
blockchain@Dao:~/hadoop-2.6.5$
来一个 wordcount 实例
./bin/hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.5.jar wordcount /input /output
登录 http://localhost:50070,查看 HDFS 相关信息。
登录 http://localhost:8088/cluster ,查看 任务运行情况。