Hadoop deployment preparation: install Linux locally under VMware. In the Linux family, the CentOS 7 download address is http://101.110.118.58/isoredirect.centos.org/centos/7/isos/x86\_64/CentOS-7-x86\_64-Minimal-1611.iso The matching Java version is 1.8.0_121 Hadoop version 2.8.0 download address http://mirror.bit.edu.cn/apache/hadoop/common/ you can download whichever version you like
1. Basic configuration
First install a CentOS 7 and get Java configured. Java environment configuration: my Java install location is /usr/java/ jdk1.8.0_121 edit the Java environment with vi ~/.bash_profile, add or modify export JAVA_HOME=/usr/java/jdk1.8.0_121 export PATH=$JAVA_HOME/bin:$PATH then run . ~/.bash_profile to make the variables take effect
2. SSH configuration
First run yum install ssh to install it then run ssh-keygen -t dsa -P ‘’ -f ~/.ssh/id_dsa to generate the key
3. Hadoop configuration
Extract the Hadoop you downloaded. (Mine is in the /roo directory, so the full path is /root/hadoop) Configure the environment variables: vi ~/.bash_profile export HADOOP_HOME=/root/hadoop export PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$HADOOP_HOME/bin then run . ~/.bash_profile to make the variables take effect
4. Hadoop file configuration
First give this machine a name: for example mine is s204 so run hostnamectl set-hostname s204 to change the hostname then, in the /root/hadoop directory, edit the following files in order
vim etc/hadoop/core-site.xml
In
vim etc/hadoop/hdfs-site.xml
In
vim etc/hadoop/mapred-site.xml
In
vim etc/hadoop/yarn-site.xml
In
vim etc/hadoop/yarn-env.sh
Find export JAVA_HOME, uncomment it and edit the Java path to export JAVA_HOME=/usr/java/jdk1.8.0_121 Find JAVA_HEAP_MAX=-Xmx1000m and change it to JAVA_HEAP_MAX=-Xmx1024m
vim etc/hadoop/slaves
Clear it and add s204
Network configuration
My IP is 192.168.5.9 edit the network to use a fixed IP: vim /etc/sysconfig/network-scripts/ifcfg-ens33 set the fixed IP TYPE=”Ethernet” #BOOTPROTO=”dhcp” DEFROUTE=”yes” PEERDNS=”yes” PEERROUTES=”yes” IPV4_FAILURE_FATAL=”no” IPV6INIT=”yes” IPV6_AUTOCONF=”yes” IPV6_DEFROUTE=”yes” IPV6_PEERDNS=”yes” IPV6_PEERROUTES=”yes” IPV6_FAILURE_FATAL=”no” IPV6_ADDR_GEN_MODE=”stable-privacy” NAME=”ens33” UUID=”b9fe1e5c-be20-47f1-a2d3-e12f5ddb6aa1” DEVICE=”ens33” ONBOOT=”yes” IPADDR0=192.168.5.9 PREFIX0=24 GATEWAY0=192.168.5.2 DNS1=114.114.114.114 then restart the network with systemctl restart network run ip add to check whether the network IP matches what you set
Starting Hadoop
Go into the /root/hadoop directory run the format command ./bin/hdfs namenode –format if “Exiting with status 0” shows up on the fifth line from the bottom, it succeeded then start it with ./sbin/start-all.sh once it’s up, run ./bin/hdfs dfsadmin –report to see whether there are nodes; if it returns “cannot connect”, startup failed run systemctl stop firewalld.service to turn off the firewall then enter s204:8088 in a browser and you’ll see the Hadoop interface
Configuring the other nodes
Once the above is configured, shut down CentOS 7 and do a full clone. In the newly cloned system, change the IP address and hostname. Note that in the Hadoop config file etc/hadoop/hdfs-site.xml the file address in

