ubuntu14.04 Hadoop Installation

Source: Internet
Author: User
Tags ssh server

1. Create a user group

sudo addgroup Hadoop

2. Create user

sudo adduser-ingroup Hadoop Hadoop

Enter the password after entering, enter the password you want to set and then go all the way.

3. Add Permissions for Hadoop users

sudo gedit/etc/sudoers

Then save the exit.

4. Switch User Hadoop login operating system

5. Install SSH

sudo apt-get Install Openssh-server

Start the SSH Server service after installation is complete

Sudo/etc/init.d/ssh start

To see if the SSH service is started

Ps-e | grep ssh

If you see a word like SSH stating that the boot was successful

6. Set password-free login, generate private key and public key

""

Two files are generated under/home/hadoop/.ssh: Id_rsa and Id_rsa.pub, which is the private key and the latter is the public key.

Next we append the public key to Authorized_keys, which saves all the public key content that allows the user to log on to the SSH client as the current user.

Cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

7. Login to SSH

SSH localhost

Exit

Exit


8. Installing the JDK

sudo apt-get install openjdk-7-jdk

OPENJDK is installed here.

To view the installation results, enter the command:

Java-version

If Java version appears ... The typeface indicates that the installation was successful

9, installation hadoop2.7.0

First download official website download (hadoop-2.7.0.tar.gz): http://mirror.bit.edu.cn/apache/hadoop/common/

10, installation hadoop2.7.0

Extract:

sudo tar xzf hadoop-2.7. 0. tar.gz   

Copy to/usr/local/hadoop directory after decompression

sudo mv hadoop-2.7. 0 /usr/local/hadoop     

To set access permissions for/usr/local/hadoop

777 /usr/local/hadoop

11. Configuration


Configure ~/.BASHRC to see the JDK installation path First

  Update-alternatives--config Java

The full path is

/usr/lib/jvm/java-7-openjdk-i386/jre/bin/java

We only take the previous part/usr/lib/jvm/java-7-openjdk-i386

Configure the. bashrc file

sudo gedit ~/.BASHRC

The command opens the edit window for the file, appends the following to the end of the file, and then saves and closes the editing window.

#HADOOP VARIABLES startexport java_home=/usr/lib/jvm/java-7-openjdk-i386
Export Hadoop_install=/usr/local/Hadoopexport PATH= $PATH: $HADOOP _install/Binexport PATH= $PATH: $HADOOP _install/Sbinexport hadoop_mapred_home=$HADOOP _installexport hadoop_common_home=$HADOOP _installexport hadoop_hdfs_home=$HADOOP _installexport yarn_home=$HADOOP _installexport Hadoop_common_lib_native_dir= $HADOOP _install/lib/Nativeexport hadoop_opts="-djava.library.path= $HADOOP _install/lib"#HADOOP VARIABLES END

Execute the following to make the added environment variable effective:

SOURCE ~/.BASHRC

Edit/usr/local/hadoop/etc/hadoop/hadoop-env.sh

Execute the following command to open the edit window for the file

sudo gedit/usr/local/hadoop/etc/hadoop/hadoop-env.sh

Locate the Java_home variable and modify the variable as follows

Export java_home=/usr/lib/jvm/java-7-openjdk-i386

To this motor mode has been installed complete below a simple wordcount test

Create input folder under/usr/local/hadoop path

mkdir input

Copy README.txt to input

CP README.txt Input

Executive WordCount

Bin/hadoop Jar Share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.7.0-sources.jar Org.apache.hadoop.examples.WordCount Input Output

If a similar message appears stating that the execution was successful

See the results below

Perform

Cat Output/*

ubuntu14.04 Hadoop Installation

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.