热门IT资讯网

hadoop的部署以及应用

发表于:2024-11-24 作者:热门IT资讯网编辑
编辑最后更新 2024年11月24日,1.基础环境[hadoop@master ~]$ cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [hadoop@maste

1.基础环境

[hadoop@master ~]$ cat  /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [hadoop@master ~]$ [hadoop@master ~]$ getenforce Disabled[hadoop@master ~]$ systemctl  status  firewalld ● firewalld.service - firewalld - dynamic firewall daemon   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)   Active: inactive (dead)[hadoop@master ~]$

2.IP以及对应节点


IP主机名hadoop nodehadoop 进程名称
192.168.56.100mastermaster
namenode,jobtracker

192.168.56.101slave1slavedatanode,tasktracker
192.168.56.102slave2slavedatanode,tasktracker
192.168.56.103slave3slavedatanode,tasktracker
[hadoop@master ~]# cat  /etc/hosts192.168.56.100  Master192.168.56.101  slave1192.168.56.102  slave2192.168.56.103  slave3[hadoop@master ~]#

3.增加hadoop用户,所有节点

useradd  hadoopecho hadoop|passwd  --stdin  hadoop

4.jdk

[hadoop@slave1 application]# lltotal 4lrwxrwxrwx 1 root root   24 Jul 10 01:35 jdk -> /application/jdk1.8.0_60drwxr-xr-x 8 root root 4096 Aug  5  2015 jdk1.8.0_60[hadoop@slave1 application]# pwd/application[hadoop@slave1 application]# [hadoop@master ~]# java  -version java version "1.8.0_60"Java(TM) SE Runtime Environment (build 1.8.0_60-b27)Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)[hadoop@master ~]#

5.master(192.168.56.100)上的hadoop用户可以ssh所有slave节点的hadoop用户下

6.设置hadoop安装路径 以及环境变量(所有节点)

su  -  hadooptar xf  hadoop-2.7.0tar.gz/home/hadoop/hadoop-2.7.0vi /etc/profile  添加hadoop环境变量export HADOOP_HOME=/home/hadoop/hadoop-2.7.0export PATH=$PATH:$HADOOP_HOME/binsource /etc/profile

7.修改hadoop的环境的Java环境变量

/home/hadoop/hadoop-2.7.0/etc/hadoopvi hadoop-env.sh 添加###JAVA_HOMEexport JAVA_HOME=/application/jdk/

8.修改hadoop的配置文件

cd  /home/hadoop/hadoop-2.7.0/etc/hadoop1.##############################[hadoop@master hadoop]$ cat core-site.xml fs.default.name  hdfs://master:9000  hadoop.tmp.dir /home/hadoop/tmp[hadoop@master hadoop]$ 2.###################################(默认不存在 拷贝个模板即可)[hadoop@master hadoop]$ cat mapred-site.xml  mapred.job.tracker  master:9001  mapred.local.dir /home/hadoop/tmp[hadoop@master hadoop]$ 3.#########################################[hadoop@master hadoop]$ cat  hdfs-site.xmldfs.name.dir/home/hadoop/name1,/home/hadoop/name2,/home/hadoop/name3   dfs.data.dir/home/hadoop/data1,/home/hadoop/data2,/home/hadoop/data3   dfs.replication  3[hadoop@master hadoop]$ [hadoop@master hadoop]$ cat masters master[hadoop@master hadoop]$ cat slaves slave1slave2slave3[hadoop@master hadoop]$

9.分发到slave节点

scp   -r  /home/hadoop/hadoop-2.7.0  slave1:/home/hadoop/scp   -r  /home/hadoop/hadoop-2.7.0  slave2:/home/hadoop/scp   -r  /home/hadoop/hadoop-2.7.0  slave3:/home/hadoop/

10.master 节点测试

/home/hadoop/name1 /home/hadoop/name2  /home/hadoop/name3  这三个目录不要创建,如果创建会提示重新reloadcd  /home/hadoop/hadoop-2.7.0[hadoop@master hadoop-2.7.0]$ ./bin/hadoop namenode -formatDEPRECATED: Use of this script to execute hdfs command is deprecated.Instead use the hdfs command for it.17/07/10 02:57:34 INFO namenode.NameNode: STARTUP_MSG: /************************************************************STARTUP_MSG: Starting NameNodeSTARTUP_MSG:   host = Master/192.168.56.100STARTUP_MSG:   args = [-format]STARTUP_MSG:   version = 2.7.0STARTUP_MSG:   classpath = /home/hadoop/hadoop-2.7.0/etc/hadoop:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-lang-2.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/hadoop-auth-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/curator-recipes-2.7.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-collections-3.2.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/xmlenc-0.52.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/htrace-core-3.1.0-incubating.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jetty-util-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-beanutils-core-1.8.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-digester-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jsp-api-2.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/httpcore-4.2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/mockito-all-1.8.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/hadoop-annotations-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/junit-4.11.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-logging-1.1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-configuration-1.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-compress-1.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jersey-json-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jettison-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/hamcrest-core-1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-net-3.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-cli-1.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-math4-3.1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/stax-api-1.0-2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-codec-1.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jsr305-3.0.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/snappy-java-1.0.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jetty-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/guava-11.0.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/avro-1.7.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/paranamer-2.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-beanutils-1.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jsch-0.1.42.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jets3t-0.9.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/activation-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/servlet-api-2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/xz-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-httpclient-3.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/gson-2.2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/curator-framework-2.7.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/httpclient-4.2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/curator-client-2.7.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/slf4j-api-1.7.10.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/lib/zookeeper-3.4.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/hadoop-nfs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/hadoop-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/common/hadoop-common-2.7.0-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/htrace-core-3.1.0-incubating.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/leveldbjni-all-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jsr305-3.0.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/guava-11.0.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/xercesImpl-2.9.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/netty-all-4.0.23.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/lib/xml-apis-1.3.04.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-nfs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-2.7.0-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-lang-2.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-collections-3.2.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/javax.inject-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/aopalliance-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-compress-1.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-json-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jettison-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-cli-1.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-codec-1.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jsr305-3.0.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jetty-6.1.26.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/guava-11.0.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/guice-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/activation-1.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/servlet-api-2.5.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/xz-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/zookeeper-3.4.6-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-client-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/lib/zookeeper-3.4.6.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-sharedcachemanager-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-registry-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-tests-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-api-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-client-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/asm-3.2.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/javax.inject-1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/hadoop-annotations-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/junit-4.11.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/commons-compress-1.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/snappy-java-1.0.4.1.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/guice-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/netty-3.6.2.Final.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/avro-1.7.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/xz-1.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.0-tests.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.7.0.jar:/home/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.7.0.jar:/home/hadoop/hadoop-2.7.0/contrib/capacity-scheduler/*.jar:/home/hadoop/hadoop-2.7.0/contrib/capacity-scheduler/*.jarSTARTUP_MSG:   build = Unknown -r Unknown; compiled by 'root' on 2015-05-27T13:56ZSTARTUP_MSG:   java = 1.8.0_60************************************************************/17/07/10 02:57:34 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]17/07/10 02:57:34 INFO namenode.NameNode: createNameNode [-format]17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name1 should be specified as a URI in configuration files. Please update hdfs configuration.17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name2 should be specified as a URI in configuration files. Please update hdfs configuration.17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name3 should be specified as a URI in configuration files. Please update hdfs configuration.17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name1 should be specified as a URI in configuration files. Please update hdfs configuration.17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name2 should be specified as a URI in configuration files. Please update hdfs configuration.17/07/10 02:57:35 WARN common.Util: Path /home/hadoop/name3 should be specified as a URI in configuration files. Please update hdfs configuration.Formatting using clusterid: CID-77e0896d-bda2-49f1-8127-c5343f1c52c917/07/10 02:57:35 INFO namenode.FSNamesystem: No KeyProvider found.17/07/10 02:57:35 INFO namenode.FSNamesystem: fsLock is fair:true17/07/10 02:57:35 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=100017/07/10 02:57:35 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true17/07/10 02:57:35 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.00017/07/10 02:57:36 INFO blockmanagement.BlockManager: The block deletion will start around 2017 Jul 10 02:57:3617/07/10 02:57:36 INFO util.GSet: Computing capacity for map BlocksMap17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit17/07/10 02:57:36 INFO util.GSet: 2.0% max memory 966.7 MB = 19.3 MB17/07/10 02:57:36 INFO util.GSet: capacity      = 2^21 = 2097152 entries17/07/10 02:57:36 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false17/07/10 02:57:36 INFO blockmanagement.BlockManager: defaultReplication         = 317/07/10 02:57:36 INFO blockmanagement.BlockManager: maxReplication             = 51217/07/10 02:57:36 INFO blockmanagement.BlockManager: minReplication             = 117/07/10 02:57:36 INFO blockmanagement.BlockManager: maxReplicationStreams      = 217/07/10 02:57:36 INFO blockmanagement.BlockManager: shouldCheckForEnoughRacks  = false17/07/10 02:57:36 INFO blockmanagement.BlockManager: replicationRecheckInterval = 300017/07/10 02:57:36 INFO blockmanagement.BlockManager: encryptDataTransfer        = false17/07/10 02:57:36 INFO blockmanagement.BlockManager: maxNumBlocksToLog          = 100017/07/10 02:57:36 INFO namenode.FSNamesystem: fsOwner             = hadoop (auth:SIMPLE)17/07/10 02:57:36 INFO namenode.FSNamesystem: supergroup          = supergroup17/07/10 02:57:36 INFO namenode.FSNamesystem: isPermissionEnabled = true17/07/10 02:57:36 INFO namenode.FSNamesystem: HA Enabled: false17/07/10 02:57:36 INFO namenode.FSNamesystem: Append Enabled: true17/07/10 02:57:36 INFO util.GSet: Computing capacity for map INodeMap17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit17/07/10 02:57:36 INFO util.GSet: 1.0% max memory 966.7 MB = 9.7 MB17/07/10 02:57:36 INFO util.GSet: capacity      = 2^20 = 1048576 entries17/07/10 02:57:36 INFO namenode.FSDirectory: ACLs enabled? false17/07/10 02:57:36 INFO namenode.FSDirectory: XAttrs enabled? true17/07/10 02:57:36 INFO namenode.FSDirectory: Maximum size of an xattr: 1638417/07/10 02:57:36 INFO namenode.NameNode: Caching file names occuring more than 10 times17/07/10 02:57:36 INFO util.GSet: Computing capacity for map cachedBlocks17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit17/07/10 02:57:36 INFO util.GSet: 0.25% max memory 966.7 MB = 2.4 MB17/07/10 02:57:36 INFO util.GSet: capacity      = 2^18 = 262144 entries17/07/10 02:57:36 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.999000012874603317/07/10 02:57:36 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 017/07/10 02:57:36 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension     = 3000017/07/10 02:57:36 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 1017/07/10 02:57:36 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 1017/07/10 02:57:36 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,2517/07/10 02:57:36 INFO namenode.FSNamesystem: Retry cache on namenode is enabled17/07/10 02:57:36 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis17/07/10 02:57:36 INFO util.GSet: Computing capacity for map NameNodeRetryCache17/07/10 02:57:36 INFO util.GSet: VM type       = 64-bit17/07/10 02:57:36 INFO util.GSet: 0.029999999329447746% max memory 966.7 MB = 297.0 KB17/07/10 02:57:36 INFO util.GSet: capacity      = 2^15 = 32768 entries17/07/10 02:57:36 INFO namenode.FSImage: Allocated new BlockPoolId: BP-467031090-192.168.56.100-149962665661217/07/10 02:57:36 INFO common.Storage: Storage directory /home/hadoop/name1 has been successfully formatted.17/07/10 02:57:36 INFO common.Storage: Storage directory /home/hadoop/name2 has been successfully formatted.17/07/10 02:57:36 INFO common.Storage: Storage directory /home/hadoop/name3 has been successfully formatted.17/07/10 02:57:36 INFO namenode.NNStorageRetentionManager: Going to retain 1 p_w_picpaths with txid >= 017/07/10 02:57:36 INFO util.ExitUtil: Exiting with status 017/07/10 02:57:37 INFO namenode.NameNode: SHUTDOWN_MSG: /************************************************************SHUTDOWN_MSG: Shutting down NameNode at Master/192.168.56.100************************************************************/[hadoop@master hadoop-2.7.0]$

11.启动服务

[hadoop@master sbin]$ pwd/home/hadoop/hadoop-2.7.0/sbin[hadoop@master sbin]$ [hadoop@master sbin]$ ./start-all.sh This script is Deprecated. Instead use start-dfs.sh and start-yarn.shStarting namenodes on [master]master: starting namenode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-namenode-master.outslave3: starting datanode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-datanode-slave3.outslave2: starting datanode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-datanode-slave2.outslave1: starting datanode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-datanode-slave1.outStarting secondary namenodes [0.0.0.0]0.0.0.0: starting secondarynamenode, logging to /home/hadoop/hadoop-2.7.0/logs/hadoop-hadoop-secondarynamenode-master.outstarting yarn daemonsstarting resourcemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-resourcemanager-master.outslave3: starting nodemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-nodemanager-slave3.outslave2: starting nodemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-nodemanager-slave2.outslave1: starting nodemanager, logging to /home/hadoop/hadoop-2.7.0/logs/yarn-hadoop-nodemanager-slave1.out
[hadoop@master sbin]$ netstat  -lntup (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.)Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    tcp        0      0 192.168.56.100:9000     0.0.0.0:*               LISTEN      4405/java           tcp        0      0 0.0.0.0:50090           0.0.0.0:*               LISTEN      4606/java           tcp        0      0 0.0.0.0:50070           0.0.0.0:*               LISTEN      4405/java           tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -                   tcp6       0      0 :::22                   :::*                    LISTEN      -                   tcp6       0      0 :::8088                 :::*                    LISTEN      4757/java           tcp6       0      0 ::1:25                  :::*                    LISTEN      -                   tcp6       0      0 :::8030                 :::*                    LISTEN      4757/java           tcp6       0      0 :::8031                 :::*                    LISTEN      4757/java           tcp6       0      0 :::8032                 :::*                    LISTEN      4757/java           tcp6       0      0 :::8033                 :::*                    LISTEN      4757/java           [hadoop@master sbin]$

http://192.168.56.100:50070/dfshealth.html#tab-overview

http://192.168.56.103:8042/node/allApplications

http://192.168.56.100:50090/status.html


0