Detailed steps for installing a Hadoop cluster in Linux

Source: Internet
Author: User
1.environmental requirements (the installation of centos6on the virtual machine does not require centos61_hadoop-0.21.0.tar 2. server configuration (I have two CPUs, 2 GB memory, and 100 hard disk) Here, the server IP address should be fixed, that is, we recommend that you develop the IP addresses that can be pinged to each other by using ping commands.

1. Environment requirements (the installation of Centos6 under the virtual machine will not be mentioned here)
Centos6 + hadoop-0.21.0.tar

2. server configuration (I have two CPUs here, 2 GB memory, and 100 hard disk)
In this case, the server IP address should be fixed, that is, the server IP address can be used with each other.PingCommandPing IP

We recommend that you develop it in the company. Because the company has this condition, I have configured three datanode here, which are Datanode1, Datanode2, and Datanode3 (these are the host names for creating virtual machines)

Server Name IP address (set by yourself)

Namenode 192.168.16.1

Datanode1 192.168.16.2

Datanode2 192.168.16.3

Datanode3 192.168.16.4

2.1 modify the Server IP address as follows:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = \ "eth0 \"

# Here is the physical address of your Nic. You do not need to enter the detected Nic.

# This option already exists after it is enabled and does not need to be modified

HWADDR = \ "00: 0C: 29: 95: 1D: A5 \"

BOOTPROTO = \"StatIc \"

ONBOOT = \ "yes \"

# Here is the IP address, which cannot be repeated. It is arranged in descending order from 253, and the occupied ip address cannot be used again.

IPADDR = 172.16.101.245

NETMASK = 255.255.255.0

NETWORK = 172.16.101.0

BROADCAST = 172.16.101.255

GATEWAY = 172.16.101.254

 

After exiting and saving, run the following command to make the configured gateway take effect immediately:

Shell> ifdown eth0

Shell> ifup eth0

Shell>/etc/init. d/network restart

3. Install JDK 6 (I am using a jdk-6u26-linux-x64-rpm.bin)
3.1. Create an installation directoryMkdir/Usr/java/
3.2. Move the jdk-6u26-linux-x64-rpm.bin to/usr/java/and then execute
/Jdk-6u26-linux-x64-rpm.bin

Input is required during running. The order is yes and press Enter.

After execution, a folder named jdk1.6.0 _ 26 is displayed.

3.3. Set Environment Variables
/Etc/proFileAdd the following content:

# Config java

JAVA_HOME =/usr/java/jdk1.6.0 _ 26

CLASSPATH =.: $ JAVA_HOME/lib/tooLs. Jar: $ JAVA_HOME/lib/dt. jar

PATH = $ JAVA_HOME/bin: $ HOME/bin: $ PATH

ExPort PATH JAVA_HOME CLASSPATH

3.4. Make the settings take effect: source/etc/profile
4. Install the ssh server and client
A. yum search ssh
B. Locate the server to be installed (openssh-server.x86_64 here)
C. Installation server: yum install openssh-server.x86_64
D. Install the client (openssh-clients.x86_64 here)
E. install client: yum install openssh-clients.x86_64
5. Set ssh for non-password access between Namenode and Datanode
A. Use ssh-key-gen to create a public key and a key on the local host.
Root@www.linuxIdC.com ~] # Ssh-keygen-t rsa

Enter file inWhichTo save the key (/home/jsmith/. ssh/id_rsa): [Enter key]

Enter passphrase (empty for no passphrase): [Press enter key]

Enter same passphrase again: [Pess enter key]

Your identifiCatIon has been savEdIn/home/jsmith/. ssh/id_rsa.

Your public key has been saved in/home/jsmith/. ssh/id_rsa.pub.

The keyFingerPrint is: 33: b3: fe: af: 95: 95: 18: 11: 31: d5: de: 96: 2f: f2: 35: f9

Root@www.linuxidc.com

B. Use ssh-copy-id to copy the public key to the remote host.
Root@www.linuxidc.com ~ # Ssh-copy-id-I ~ /. Ssh/id_rsa.pub root @ Datanode1

Root @ Datanode1 \'s password:

NowTrY logging into the machine,? Ssh? Root @ datanode1', and check in:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.