1. Preparation
I have a host WHOSE IP address is 192.168.27.166, and I will extend three more hosts on this basis.
Changing the host Name
/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4. Localdomain4 ::1 localhost localhost.localdomain Localhost6 localHost6. Localdomain6 192.168.27.166 S166 192.168.27.167 S167 192.168.27.168 S168 192.168.27.169 S169Copy the code
Among them, I will use s166 as the NameNode (NameNode) and the other three as datanodes.
Change the hostname
etc/hostname
2. Clone the VM
slightly
3. Change the hostname and IP address of the data node
Edit /etc/sysconfig/network-scripts/ifcfg-eno33 to edit /etc/hostnameCopy the code
Restarting the Network Service
service network restart
Verify that communication is complete
[root@s166 etc]# ping s167PING S167 (192.168.27.167) 56(84) bytes of data. 64 bytes from S167 (192.168.27.167): Icmp_seq =1 TTL =64 time= 0.249ms [root@s166 etc]# ping s168PING S168 (192.168.27.168) 56(84) bytes of data. 64 bytes from S168 (192.168.27.168): Icmp_seq =1 TTL =64 time= 0.209ms [root@s166 etc]# ping s169PING S169 (192.168.27.169) 56(84) bytes of data. 64 bytes from S169 (192.168.27.169): icmp_seq=1 TTL =64 time= 0.178msCopy the code
4. Hosts do not communicate with each other using a password
SSH Password-free login Remote copy the public key file id_rsa.pub of s166 to hosts 167-169
Test whether the configuration is successful
[root@s166 etc]# ssh s167
Last failed login: Wed Jul 25 15:50:22 EDT 2018 on tty1
There was 1 failed login attempt since the last successful login.
Last login: Wed Jul 25 10:36:57 2018 from s166
[root@s167 ~]# .Copy the code
Hadoop 4+1 file configuration
Hadoop configuration files are in /hadoop/etc/hadoop
1. core-site.xml
Set HDFS ://s166 to the server IP address
<? xml version="1.0" encoding="UTF-8"? > <? xml-stylesheettype="text/xsl" href="configuration.xsl"? > <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://s166/</value> </property> </configuration>Copy the code
2. hdfs-site.xml
The number of fragments is set to 3
<? xml version="1.0" encoding="UTF-8"? > <? xml-stylesheettype="text/xsl" href="configuration.xsl"? > <configuration> <property> <name>dfs.replication</name> <value>3</value> </property> </configuration>Copy the code
3. mapred-site.xml.template
Mapred-site.xml. template mapred-site. XML and set the execution framework of mapred-site. XML to Hadoop YARN
<? xml version="1.0"? > <configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration>Copy the code
4. yarn-site.xml
The RM hostname is set to S166
<? xml version="1.0"? > <configuration> <property> <name>yarn.resourcemanager.hostname</name> <value>s166</value> </property> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> </configuration>Copy the code
5. slaves
s167
s168
s169
Copy the code
Example Modify the /etc/hadoop/hadoop-env.sh configuration
Change the export JAVA_HOME property in this file to the absolute path of JAVA_HOME.
export JAVA_HOME=/home/fantj/jdk
Copy the code
Configuration distribution
Go to the Hadoop /etc directory and overwrite hadoop in this directory to each host.
scp -r hadoop/ root@s167:/home/fantj/hadoop/etc/
scp -r hadoop/ root@s168:/home/fantj/hadoop/etc/
scp -r hadoop/ root@s169:/home/fantj/hadoop/etc/
Copy the code
Formatting the file system
hadoop namenode -format
[root@s166 etc]# hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
18/07/27 04:17:36 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = s166/192.168.27.166
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 2.7.0
STARTUP_MSG: classpath = /home/fantj/download/hadoop-2.7.0/etc/hadoop:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/snappy-java-1.0.4.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-cli-1.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jetty-util-6.1.26.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/stax-api-1.0-2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-configuration-1.6.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/log4j-1.2.17.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/asm-3.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/servlet-api-2.5.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/hadoop-auth-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jsr305-3.0.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jsp-api-2.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/avro-1.7.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jetty-6.1.26.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/curator-framework-2.7.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-logging-1.1.3.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-net-3.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-math3-3.1.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jersey-server-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jets3t-0.9.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-compress-1.4.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/hadoop-annotations-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/gson-2.2.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jersey-json-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/activation-1.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/httpcore-4.2.5.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-codec-1.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-beanutils-1.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/curator-client-2.7.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-lang-2.6.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-collections-3.2.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/curator-recipes-2.7.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/paranamer-2.3.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/zookeeper-3.4.6.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jsch-0.1.42.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-beanutils-core-1.8.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-io-2.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-httpclient-3.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jettison-1.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/xz-1.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/netty-3.6.2.Final.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/junit-4.11.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/slf4j-api-1.7.10.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/httpclient-4.2.5.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/jersey-core-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/guava-11.0.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/commons-digester-1.8.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/hamcrest-core-1.3.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/xmlenc-0.52.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/mockito-all-1.8.5.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/lib/htrace-core-3.1.0-incubating.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/hadoop-common-2.7.0-tests.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/hadoop-common-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/common/hadoop-nfs-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/xercesImpl-2.9.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/asm-3.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/jsr305-3.0.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/netty-all-4.0.23.Final.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/leveldbjni-all-1.8.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/xml-apis-1.3.04.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/commons-io-2.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/netty-3.6.2.Final.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/guava-11.0.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/lib/htrace-core-3.1.0-incubating.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-nfs-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/hdfs/hadoop-hdfs-2.7.0-tests.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/commons-cli-1.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/aopalliance-1.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/log4j-1.2.17.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/asm-3.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/servlet-api-2.5.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jsr305-3.0.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-client-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/guice-3.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jetty-6.1.26.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-server-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/commons-compress-1.4.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-json-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/activation-1.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/commons-codec-1.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/commons-lang-2.6.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/commons-collections-3.2.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/zookeeper-3.4.6.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/commons-io-2.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jettison-1.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/xz-1.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/netty-3.6.2.Final.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/javax.inject-1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/jersey-core-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/zookeeper-3.4.6-tests.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/lib/guava-11.0.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-common-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-tests-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-client-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-sharedcachemanager-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-registry-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-common-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/yarn/hadoop-yarn-api-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/snappy-java-1.0.4.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/asm-3.2.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/guice-3.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/avro-1.7.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/commons-compress-1.4.1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/hadoop-annotations-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/xz-1.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/netty-3.6.2.Final.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/javax.inject-1.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/junit-4.11.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.0-tests.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.7.0.jar:/home/fantj/download/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.0.jar:/home/fantj/hadoop/contrib/capacity-scheduler/*.jar:/home/fantj/download/hadoop-2.7.0/contrib/capacity-scheduler/*.jar
STARTUP_MSG: build = Unknown -r Unknown; compiled by 'root' on 2015-05-21T03:49Z
STARTUP_MSG: java = 1.8.0_171
************************************************************/
18/07/27 04:17:36 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
18/07/27 04:17:36 INFO namenode.NameNode: createNameNode [-format]
Formatting using clusterid: CID-75fa7946-8fa3-4b09-83c4-00ec91f5f0b6
18/07/27 04:17:39 INFO namenode.FSNamesystem: No KeyProvider found.
18/07/27 04:17:39 INFO namenode.FSNamesystem: fsLock is fair:true
18/07/27 04:17:39 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=1000
18/07/27 04:17:39 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
18/07/27 04:17:39 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
18/07/27 04:17:39 INFO blockmanagement.BlockManager: The block deletion will start around 2018 Jul 27 04:17:39
18/07/27 04:17:39 INFO util.GSet: Computing capacity for map BlocksMap
18/07/27 04:17:39 INFO util.GSet: VM type = 64-bit
18/07/27 04:17:39 INFO util.GSet: 2.0% max memory 966.7 MB = 19.3 MB
18/07/27 04:17:39 INFO util.GSet: capacity = 2^21 = 2097152 entries
18/07/27 04:17:39 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
18/07/27 04:17:39 INFO blockmanagement.BlockManager: defaultReplication = 3
18/07/27 04:17:39 INFO blockmanagement.BlockManager: maxReplication = 512
18/07/27 04:17:39 INFO blockmanagement.BlockManager: minReplication = 1
18/07/27 04:17:39 INFO blockmanagement.BlockManager: maxReplicationStreams = 2
18/07/27 04:17:39 INFO blockmanagement.BlockManager: shouldCheckForEnoughRacks = false
18/07/27 04:17:39 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
18/07/27 04:17:39 INFO blockmanagement.BlockManager: encryptDataTransfer = false
18/07/27 04:17:39 INFO blockmanagement.BlockManager: maxNumBlocksToLog = 1000
18/07/27 04:17:39 INFO namenode.FSNamesystem: fsOwner = root (auth:SIMPLE)
18/07/27 04:17:39 INFO namenode.FSNamesystem: supergroup = supergroup
18/07/27 04:17:39 INFO namenode.FSNamesystem: isPermissionEnabled = true
18/07/27 04:17:39 INFO namenode.FSNamesystem: HA Enabled: false
18/07/27 04:17:39 INFO namenode.FSNamesystem: Append Enabled: true
18/07/27 04:17:40 INFO util.GSet: Computing capacity for map INodeMap
18/07/27 04:17:40 INFO util.GSet: VM type = 64-bit
18/07/27 04:17:40 INFO util.GSet: 1.0% max memory 966.7 MB = 9.7 MB
18/07/27 04:17:40 INFO util.GSet: capacity = 2^20 = 1048576 entries
18/07/27 04:17:40 INFO namenode.FSDirectory: ACLs enabled? false
18/07/27 04:17:40 INFO namenode.FSDirectory: XAttrs enabled? true
18/07/27 04:17:40 INFO namenode.FSDirectory: Maximum size of an xattr: 16384
18/07/27 04:17:40 INFO namenode.NameNode: Caching file names occuring more than 10 times
18/07/27 04:17:40 INFO util.GSet: Computing capacity for map cachedBlocks
18/07/27 04:17:40 INFO util.GSet: VM type = 64-bit
18/07/27 04:17:40 INFO util.GSet: 0.25% max memory 966.7 MB = 2.4 MB
18/07/27 04:17:40 INFO util.GSet: capacity = 2^18 = 262144 entries
18/07/27 04:17:40 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
18/07/27 04:17:40 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 0
18/07/27 04:17:40 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension = 30000
18/07/27 04:17:40 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 10
18/07/27 04:17:40 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 10
18/07/27 04:17:40 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,25
18/07/27 04:17:40 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
18/07/27 04:17:40 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
18/07/27 04:17:40 INFO util.GSet: Computing capacity for map NameNodeRetryCache
18/07/27 04:17:40 INFO util.GSet: VM type = 64-bit
18/07/27 04:17:40 INFO util.GSet: 0.029999999329447746% max memory 966.7 MB = 297.0 KB
18/07/27 04:17:40 INFO util.GSet: capacity = 2^15 = 32768 entries
18/07/27 04:17:40 INFO namenode.FSImage: Allocated new BlockPoolId: BP-703568763-192.168.27.166-1532679460786
18/07/27 04:17:40 INFO common.Storage: Storage directory /tmp/hadoop-root/dfs/name has been successfully formatted.
18/07/27 04:17:41 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
18/07/27 04:17:41 INFO util.ExitUtil: Exiting with status 0
18/07/27 04:17:41 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at s166/192.168.27.166
************************************************************/
Copy the code
Start the Hadoop process
start-all.sh
[root@s166 etc]# start-all.sh This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh Starting namenodes On [S166] The authenticity of Host 's166 (192.168.27.166)' can't be established. ECDSA key fingerprint is SHA256:3BePLPmiwUOy025LcIJJNvQJlKUJ3uo9T03op0XC5ws. ECDSA key fingerprint is MD5:24:ee:b2:a8:cf:df:9d:f7:cc:6c:1f:73:c5:ad:b5:b0. Are you sure you want to continue connecting (yes/no)? Yes S166: Warning: Permanently added 's166,192.168.27.166' (ECDSA) to the list of known hosts. root@s166's password: S166: starting the namenode, logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - the namenode - s166. Out s167: Starting the datanode, logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - datanode - s167. Out s169: Starting the datanode, logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - datanode - s169. Out s168: starting datanode, Logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - datanode - s168. Out Starting secondary namenodes [0.0.0.0] The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established. ECDSA key fingerprint is SHA256:3BePLPmiwUOy025LcIJJNvQJlKUJ3uo9T03op0XC5ws. ECDSA key fingerprint is MD5:24:ee:b2:a8:cf:df:9d:f7:cc:6c:1f:73:c5:ad:b5:b0. Are you sure you want to continue connecting (yes/no)? Yes 0.0.0.0: Warning: Permanently added '0.0.0.0' (ECDSA) to the list of known hosts. [email protected]'s password: 0.0.0.0: starting secondarynamenode, Logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - secondarynamenode - s166. Out starting yarn daemons starting The resourcemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - the resourcemanager - s166. Out s168: Starting nodemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - nodemanager - s168. Out s167: Starting nodemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - nodemanager - s167. Out s169: Starting nodemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - nodemanager - s169. OutCopy the code
Verifying configuration success
View the information printed on the console
S166: starting the namenode, logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - the namenode-s166. Out s167: starting the datanode, logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - datanode-s167. Out s169: starting the datanode, logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - datanode-s169. Out s168: starting the datanode, logging to/home/fantj/download/hadoop - 2.7.0 / logs/hadoop - root - datanode-s168. The out starting the resourcemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - the resourcemanager-s166. Out s168: starting nodemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - nodemanager-s168. Out s167: starting nodemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - nodemanager-s167. Out s169: starting nodemanager, logging to/home/fantj/download/hadoop - 2.7.0 / logs/yarn - root - nodemanager-s169.out
Copy the code
If an error occurs, check log analysis.
NameNode Host verification
[root@s166 etc]# jps
1397 NameNode
1559 SecondaryNameNode
1815 Jps
1727 ResourceManager
Copy the code
DataNode Host verification
[root@s168 ~]# jps
11281 Jps
1815 NodeManager
1756 DataNode
Copy the code