Installation of Hadoop software
1. Create a folder MyApps in the home directory
two。 Extract the compressed file to this directory
The command format is: tar-zxvf compressed file-C decompression path
3. Configure the network environment
4.1 temporarily modify the hostname
Temporarily set hostname, which will expire after the system is rebooted
4.2 permanently modify the hostname
Vi / etc/sysconfig/network modification file
Cat / etc/sysconfig/network view the modified file
Source / etc/sysconfig/network executes the modified file
Hostname hostname causes the set hostname to take effect immediately
Hosname View Hostname
5. Configure the hosts file
Ifconfig check ip address: 192.168.159.10
Vi / etc/hosts Open the hosts file and add configuration: 192.168.159.10 HadoopMaster
Cat / etc/hosts View configuration
6. Turn off the firewall
View the status of the firewall: service iptables status
Temporarily turn off the firewall: service iptables stop
Permanently shut down the firewall of a certain startup mode: chkconfig iptables-- level 4 off
Permanently turn off the firewall of all startup modes: chkconfig iptables off
7. Configure environment variables for jdk and Hadoop
Open the configuration file: vi / etc/profile
Add configuration text at the end of the file:
Refresh a profile file: source / etc/profile
Close selinux: vi / etc/sysconfig/selinux SELINUX=disabled
8. Open the path / home/hadoop/MyApps/hadoop-2.4.1/etc/hadoop where Hadoop is located
Configure the following files:
8.1core-site.xml
8.2 add export JAVA_HOME=Java path in hadoop-env.sh
8.3 profile hdfs-site.xml Fil
8.4 configure the mapred-site.xml file
8.5 configure yarn-site.xml Fil
9. Format namenode: hdfs namenode-foormat
10. Start Hadoop
11. Verify that it is successful