- Install JDK
- Turn off the firewall
service iptables stop
chkconfig iptables off - Turn off the boot initialization of the cloud host
service cloud-init stop
chkconfig cloud-init off
service cloud-init-local stop
chkconfig cloud-init-local off - Modify the host name
vim /etc/sysconfig/network to
modify the value of HOSTNAME, for example, modify HOSTNAME to hadoop01. After the
change, save and exit, and re-validate
source /etc/sysconfig/network - Map the host name and IP
vim /etc/hosts
add IP host name
save and exit - Reboot
reboot - Password
- free login Generate key: ssh-keygen — press Enter all the way, no need to enter any data
Copy public key: ssh-copy-id root@hadoop01
Test: ssh hadoop01 If you don’t need any password after press enter, it means the secret-free is successful Then enter logout - Download the Hadoop installation package
cd /home/software/
wget http://bj-yzjd.ufile.cn-north-02.ucloud.cn/hadoop-2.7.5.tar.gz - Unzip
tar -xvf hadoop-2.7.5.tar.gz - Enter the subdirectory
cd hadoop-2.7.5/etc/hadoop/ - Edit
vim hadoop-env.sh
modify the properties
export JAVA_HOME=/home/presoftware/jdk1.8
export HADOOP_CONF_DIR=/home/software/hadoop-2.7.5/etc/hadoop
save and exit, re-validate
source hadoop-env.sh - Edit
vim core-site.xml to
add
fs.defaultFS
hdfs://hadoop01:9000
hadoop.tmp.dir
/home/software/hadoop-2.7.5/tmp
save and exit - Edit
vim hdfs-site.xml to
add
dfs.replication
1
save and exit - Edit
cp mapred-site.xml.template mapred-site.xml
vim mapred-site.xml to
add
mapreduce.framework.name
yarn to
save and exit - Edit
vim yarn-site.xml to
add
yarn.resourcemanager.hostname
hadoop01
yarn.nodemanager.aux-services
mapreduce_shuffle
save and exit - Edit
vim slaves to
delete localhost, add the current host name,
save and exit - Modify the environment variable
vim /etc/profile
and append
export HADOOP_HOME=/home/software/hadoop-2.7.5
export PATH= PATH: PATH: at the end of the filePATH: HADOOP_HOME/bin:$HADOOP_HOME/sbin
save and exit, re-validate
source /etc/profile - Format Hadoop
hadoop namenode -format,
if Storage directory /home/software/hadoop-2.7.5/tmp/dfs/name has been successfully formatted, it means that the formatting is successful - Start Hadoop
start-all.sh - View the process through jps
Jps
NameNode port: 50070
DataNode port: 50075
SecondaryNameNode port: 50090
ResourceManager port: 8088
NodeManager
Common errors:
1. If Name or Service not known or Unknown Host appears, then the host name is configured incorrectly, check the /etc/hosts file
2. If Command not found appears, then the environment variable is configured incorrectly, or there is no source after the configuration is complete
3. If NameNode/DataNode/SecondaryNameNode is missing, then check core-site.xml/hdfs-site.xml is configured correctly
4. If ResourceManager/NodeManager is missing, then check mapred-site.xml/yarn-site.xml Configured correctly