Hadoop installation (Ubuntu Kylin 14.04)

Source: Internet
Author: User
Tags xsl

Installation environment: Ubuntu Kylin 14.04 haoop-1.2.1 HADOOP:HTTP://APACHE.MESI.COM.AR/HADOOP/COMMON/HADOOP-1.2.1/

1. To install the JDK, it is important to note that in order to use Hadoop, you need to enter a command under Hadoop:source/etc/profile to implement it, and then use java-version Test to see if it takes effect.

2. Create Hadoop users and user groups (switch to root)

Create a Hadoop user sudo addgroup hadoop Group

Create a Hadoop sudo adduser -ingroup hadoop hadoop User

Add permissions to the Hadoop user to open the/etc/sudoers file;  sudo vim /etc/sudoers

Pressing ENTER will open the/etc/sudoers file, giving the Hadoop user the same permissions as the root user.

Add Hadoop all= (All:all) all under root all= (All:all) All, that is:Hadoop all= (all:all) all so you can use sudo.

3. Install SSHSSH can be used for remote login and management. Installing Openssh-server  sudo  apt-get install  ssh  openssh-server   Note: Ubuntu Install Openssh-server report relies on the wrong resolution process     服务启动:sudo /etc/init.d/ssh start     查看服务启动是否正确:ps -e | grep ssh     SSH generated key has RSA and DSA two ways of generation, by default, RSA mode. Create ssh-key (Switch to Hadoop), where we use the RSA approach; ssh -keygen -t rsa -P "" 回车后会在~/.ssh/下生成两个文件:id_rsa和id_rsa.pub这两个文件是成对出现的Into the ~/.ssh/directory, the Id_rsa.pub appended to the Authorized_keys authorization file, the beginning is no Authorized_keys file;Note:One problem here may be that after authorization, there is no password login: That is because Authorized_keys permissions must be changed to 600,authorized_keys in./hadoop/.ssh/Under cd  ~/. ssh     cat  id_rsa.pub >> authorized_keysLogin: ssh  localhost Exit:ExitThis allows for password-free login.

4. Extract the Hadoop source package

Access the Hadoop source package directory under the terminal, copy the Hadoop source package to/home/hadoop using the copy command

1 CP Hadoop-1.2.1.tar.gz/home/hadoop

Then unzip the command line as follows

TAR-XZVF *.tar.gz

5, configure the Hadoop-env.sh,core-site.xml,mapred-site.xml,hdfs-site.xml under hadoop/conf of Hadoop

Configure hadoop-1.2.1/conf/hadoop-env.sh, command line:

1 vim/home/hadoop/hadoop-1.2.1/conf/hadoop-env.sh

Find Java_home

Remove the previous #, plus the system JDK path, save exit

Configure Hadoop-1.2.1/conf/core-site.xml, command line:

Gedit/home/hadoop/hadoop-1.2.1/conf/core-site.xml

Create a new hadoop_tmp directory in Hadoop because of http://blog.csdn.net/bychjzh/article/details/7830508

Add the following <configuration> </configuration> to enter, save exit

<?xml version= "1.0"? ><?xml-stylesheet type= "text/xsl" href= "configuration.xsl"?><!--Put Site-specific property overrides the this file. --><configuration>        <property>            <name>fs.default.name</name>            <value >hdfs://localhost:9000</value>        </property>    <property>          <name> hadoop.tmp.dir</name>          <value>/home/hadoop/hadoop-1.2.1/hadoop_tmp</value>         < Description>a base for other temporary directories.</description>    </property></configuration >

Configure Hadoop-1.2.1/conf/mapre-site.xml, command line:

1 vim/home/hadoop/hadoop-1.2.1/conf/mapre-site.xml

Add the following <configuration> </configuration> to enter, save exit

<?xml version= "1.0"? ><?xml-stylesheet type= "text/xsl" href= "configuration.xsl"?><!--Put Site-specific property overrides the this file. --><configuration>    <property>        <name>mapred.job.tracker</name>        <value >localhost:9001</value>    </property></configuration>

Configure Hadoop-1.2.1/conf/hdfs-site.xml, command line:

1 vim/home/hadoop/hadoop-1.2.1/conf/hdfs-site.xml

Add the following <configuration> </configuration> to enter, save exit

<?xml version= "1.0"? ><?xml-stylesheet type= "text/xsl" href= "configuration.xsl"?><!--Put Site-specific property overrides the this file. --><configuration>    <property>        <name>dfs.replication</name>        <value >1</value>    </property></configuration>

At this point, the installation configuration for Hadoop is complete, and later the first operation of Hadoop

6. Format HDFs File system

Enter hadoop-1.2.1

./bin/hadoop Namenode-format

When you see it,

Congratulations, HDSF. File System format succeeded

7. Start the Hadoop service

./bin/start-all.sh

The following screen appears

JPs

JPS is a Java thread that looks at the Java Virtual machine running

Then the following screen appears

Regardless of JPS, there are five Hadoop-related threads, congratulations, Hadoop installation configuration is successful and functioning properly.

You can then exit Hadoop. , then start again later, import the data


Note: Workarounds for users not in the Sudoers file

Hadoop installation (Ubuntu Kylin 14.04)

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.