The installation method described below is installed online, if you need to connect the network please refer to: Linux: web Hosting with VMware internal Linux14.04 virtual machine (static IP) connected by bridging mode
Os:linux Ubuntu14.04 Server X64;
Server list:
192.168.1.200 Master
192.168.1.201 Node1
192.168.1.202 Node2
192.168.1.203 Node3
- Installing the SSH Service
To test if SSH is installed:
sudo ps-e | grep ssh
If a process that contains sshd is returned, it indicates that the Openssh-server service has been installed, otherwise it is not installed.
To install the Openssh-server service:
sudo apt-get install Openssh-server
If you are prompted to fail the installation, perform the update command:
sudo apt-get update
However, I encountered a problem during the update process, the implementation of the installation of SSH also has a problem: package Openssh-server was not available, but was referred to by another.
For the solution please refer to: Linux: Install Openssh-server e:package openssh-server has no installation candidate
SSH Service operation command:
Note:
In order to implement each sub-node can use Putty Connection, the master,node1,node2,node3 are installed SSH services.
In fact, if master can log on to each child node without a password, the other child nodes (NODE1,NODE2,NODE3) must also have the SSH service installed.
- Configure SSH password-free login for master machine
1) Set master SSH to automatically login without password
Switch to Hadoop account (ensure user Hadoop can log in without a password, the account that Hadoop belongs to is the Hadoop account that should be installed behind us)
Su-/home/hadoopssh-keygen-t RSA
Then will encounter three times let input, the first direct carriage, the second and third is: let enter the password and confirm the password, we are here to achieve no password login. So the above three times the input is directly enter, do not set what password, that is, the blank password login.
2) then/home/hadoop/will produce a. ssh folder; LS view:
3) Append the public key to the Authorized_keys file
CP ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
4) master native uses SSH localhost test:
The first time you will be prompted whether "is you sure want to continue connecting (yes/no)?", enter Yes directly, the next time you enter SSH localhost will not be prompted.
5) Modify the hosts for each node (MASTER,NODE1,NODE2,NODE3):
Statistics add the following host list:
The purpose is to use the SSH connection for the rear, without entering the IP, using the machine name.
6) In order to ensure that master can automatically log on to Node1,node2 and Node3 without a password, Authorized_keys is now generated on Node1,node2 and Node3.
(Three child nodes Node1,node2,node3) execute the command:
/home/hadoopssh-keygen-t RSA
Return to the same way as the master installation.
7) Copy the Authorized_keys on master to three sub-nodes (NODE1,NODE2,NODE3):
First, to avoid permissions problems, we can set up file and directory permissions beforehand:
# Set Authorized_keys permissions $ chmod# set. SSH directory permissions $ chmod 700-r. SSH
Then copy the Authorized_keys on master to three sub-nodes (NODE1,NODE2,NODE3)
Here you will be prompted to enter your password and enter your Hadoop account password.
8) test: SSH node1, ssh node2 and ssh node3 (the first time you need to enter Yes)
If you do not need to enter a password, it indicates a successful configuration or the configuration fails.
Resources:
Ssh-keygen's explanation: http://blog.csdn.net/wh_19910525/article/details/7433164
Hadoop cluster Configuration (most comprehensive summary): http://blog.csdn.net/hguisu/article/details/7237395
Linux: Implementing Hadoop cluster Master no password login (SSH) Individual subnodes