This Hadoop cluster installation uses a total of four nodes, each node IP is as follows:
Master |
172.22.120.191 |
Slave1 |
172.22.120.192 |
Slave2 |
172.22.120.193 |
Slave3 |
172.22.120.193 |
System version CentOS 6.2L
JDK Version: 1.7
Hadoop version: 1.1.2
After completing the four-node system installation, start installing Hadoop:
1. Configure the hosts file
2. Configure SSH password-free login
3. Installing the JDK
4. Download and unzip Hadoop
5. Configure Namenode, modify site file
6. Configuring the hadoop-env.sh file
7. Configuring Masters and slaves files
8. replicating Hadoop to each node
9. formatting Namenode
start Hadoop
Jps detect whether the boot was successful
viewing clusters through the web
1 Configure the hosts file
Hadoop uses multiple ports, preferably opening the appropriate port or shutting down the firewall before starting configuration
The CentOS command is:
Chkconfig iptables off
Service Iptables Stop
In order to facilitate operation, we directly configure the Hosts file, you can use Master,slave in the future instead of IP
2 Configuring SSH Password-Free login
Because Hadoop needs to manage the other nodes with the master node, it needs to send the master's public key to the other nodes, and using SSH can reduce the number of operations.
To return to the Hadoop account, create a key for the Hadoop user:
After the key is generated, rename public key to the Authorized_keys file and test for password-free login:
Input command: SSH master, detect whether a password is required, the first time will be prompted to save the key, enter Yes, the other three nodes to perform the same operation.
Finally, the contents of the id_rsa.pub of the master node are appended to the Authorized_keys of the other three nodes.
If successful, you can connect to the other nodes directly using SSH slave.
3 Installing the JDK
Check your own JDK first, here is openjdk, we need to uninstall and reinstall the JDK
View the OpenJDK dependency package, and then click Uninstall
Copy the JDK file to the master node/usr/local directory and unzip it.
Modify the/etc/profile file to add the JDK directory
Input source/etc/profile make configuration effective
Last view Java version
Keep the JDK version and path of each node as long as possible to facilitate subsequent installation
4 Download and unzip Hadoop
Modify the/etc/profile file to add a Hadoop path
Finally make the profile file effective, enter Source/etc/profile
5 Configure Namenode , modify the site file
6 Configure hadoop-env.sh file
7 Configure Masters and Slaves file
8 replicate Hadoop to each node
Perform the same operation on the other nodes, sending the Hadoop file to the node
9 Formatting Namenode
Formatting namenode on first boot, multiple formatting may make namenode and Datanodeid inconsistent
Ten start Hadoop
One Jps detect if the start is successful
A View cluster status from the website
Hadoop Configuration Installation Manual