At the beginning of November, we learned about Ubuntu 12.04 's way of building a Hadoop cluster environment, and today we'll look at how Ubuntu12.04 builds Hadoop in a stand-alone environment.
A. You want to install Ubuntu this step is omitted;
Two. Create a Hadoop user group and user under Ubuntu;
1. Create a Hadoop user group:
As shown in figure:
2. Create a Hadoop User:
sudo adduser-ingroup Hadoop Hadoop |
As shown in figure:
3. Add permissions to the Hadoop user to open the/etc/sudoers file:
Pressing ENTER will open the/etc/sudoers file, giving the Hadoop user the same permissions as the root user.
Add the Hadoop all= (All:all) all under root all= (All:all) all,
Hadoop all= (All:all) all |
As shown in figure:
Three. Install JDK under Ubuntu
Execute with the following command:
sudo apt-get install Openjdk-6-jre |
As shown in figure:
Four. Modify Machine name
Every time the Ubuntu installation succeeds, our machine name defaults to: Ubuntu, but in order to be able to easily distinguish the servers in the cluster, we need to give each machine a different names. The machine name is determined by the/etc/hostname file.
1. Open/etc/hostname File:
2. Change the Ubuntu in the/etc/hostname file to the name of the machine you want to take. Here I take "Dubin-ubuntu". The system will not take effect until it is restarted.
Five. Install SSH service
SSH here and the three broad framework: Spring,struts,hibernate does not matter, SSH can achieve remote login and management, can refer to other relevant information.
Install Openssh-server,
sudo apt-get install SSH openssh-server |
If you have already installed SSH, you can proceed to the sixth step OH
vi. Establishment of SSH password-free login this machine
First to convert to a Hadoop user, execute the following command:
As shown in figure:
The SSH generation Key has RSA and DSA two ways of generation, by default, RSA approach.
1. Create Ssh-key, here we use RSA Way:
As shown in figure:
(Note: Two files are generated under ~/.ssh/after a carriage return: Id_rsa and id_rsa.pub These two files appear in pairs)
2. Into the ~/.ssh/directory, the Id_rsa.pub appended to the Authorized_keys authorization file, the beginning is not Authorized_keys file:
CD ~/.ssh Cat Id_rsa.pub >> Authorized_keys |
As shown in figure:
(After completion, you can log on to this machine without a password.) )
3. Login localhost:
As shown in figure:
(Note: When SSH telnet to another machine, you now control the remote machine, you need to perform an exit command to regain control of the local host.) )
4. Execute Exit Command: