Install the Hadoop standalone version under CentOS

Source: Internet
Author: User
Tags mkdir ssh

1. Install JDK First

Because Hadoop needs to run in the Java environment, you need to install the JDK before you install it.

JDK Installation steps:

1 if CentOS has a low version of the JDK, please uninstall it first.

2 in the official website http://www.oracle.com/technetwork/java/javase/downloads/ jdk7-downloads-1880260.html Download jdk-7u79-linux-x64.rpm (64-bit system, also optional 32-bit).

3 The new Java directory under/usr: Mkdir/usr/java

4 Copy the downloaded installation files to the Usr/java directory

5) Install JDK:RPM-IVH jdk-7u79-linux-x64.rpm.

6 Configure Environment variables: vi/etc/profile

To include in the file:

Exportpath USER LOGNAME MAIL HOSTNAME histsize Histcontrol

Exportjava_home=/usr/java/jdk1.7.0_60

Exportpath= $JAVA _home/bin: $PATH

Exportclasspath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Let environment variables take effect: Source/etc/profile

7 The JDK is installed and configured, and the current Java version can be viewed through the java-version command.


2.SSH Password-free authentication configuration

Because Hadoop needs to use the SSH protocol, SSH is configured with no password authentication to avoid constant input.

SSH password-free authentication configuration step:

1 Generate key pair: [root@localhost ~]# ssh-keygen-t dsa-p '-F ~/.SSH/ID_DSA


The above command will generate the ID_DSA private key and the Id_dsa.pub public key in the/root/.ssh/directory.


2 Enter the/root/.ssh directory under the Namenode node to do the following configuration: [root@localhost.ssh]# cat id_dsa.pub > Authorized_keys

3 You can use the type Sshlocalhost command to see already connected: At this time with SSH into the localhost no longer need a password.


3. Installing Hadoop

This installation and configuration is a stand-alone version of Hadoop, primarily to understand the installation process of Hadoop and basic operations.

Hadoop stand-alone installation and configuration steps:

1 First download the installation package from the official website http://hadoop.apache.org/releases.html, I download the 2.6.0 version of the hadoop-2.6.0.tar.gz.

2 Create folders under USR Hadoop:mkdir Hadoop (this is the path to choose from)

3 Extract the downloaded tar.gz installation package to the/usr/hadoop directory: TAR-ZXVF hadoop-2.6.0.tar.gz/usr/hadoop

4 Enter the/usr/hadoop/etc/hadoop/to modify the hadoop-env.sh file, configure the Java environment:

At the end add


5) Modify the Core-site.xml under Hadoop/etc/, hdfs-site.xml,mapred-site.xml three namenode profiles: corresponding to/src/core/ Core-default.xml, but you can't modify it directly (Hadoop starts by reading the core/core-default.xml,hdfs/hdfs-default.xml,apred/under SRC) Mapred-default.xml, the missing variable is provided by three-site files below Conf.

A) Configure Core-site.xml:


b) Configure Hdfs-site.xml:


c) Configure Mapred-site.xml. Template


6 Start Hadoop:

(a) format namenode:


b Start the Hadoop daemon: If a graphical effect occurs after the JPS is executed, the configuration is successful.




The configuration is successful at this time and can be viewed through the browser

namenode-http://localhost:50070/


jobtracker-http://localhost:8088/(Hadoop 2.0 from the original 50030 port to 8088 Port).


Related Article

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.