Hadoop Installation 1.0 (simplified version)

Source: Internet
Author: User
Tags zookeeper hadoop fs

Premise:

Make sure the iptables is off and SELinux is disabled


1. Prepare the hardware


1 sets of Namenode and 3 Datanode

Namenode 192.168.137.100

Datanode1 192.168.137.101

Datanode2 192.168.137.102

Datanode3 192.168.137.103


2. Build Hadoop users on 4 machines (can also be other user names)


Useradd Hadoop


3. Install JDK 1.6 on 4 machines


Post-installation java_home on/JDK

Configuring Environment variables

Vim/etc/bashrc

Export JAVA_HOME=/JDK

Scp-r/jdk* datanode1:/

Scp-r/jdk* datanode2:/

Scp-r/jdk* datanode3:/


4, configure the multi-machine trust of 4 machines


Be sure to remember the nodes '

/home/hadoop/.ssh

And all files below it are set to 700 permission bits


5. Install Hadoop


Tar zxvf Hadoop-1.0.4.tar


Installed in/hadoop

Set the/hadoop permission location to 755


vim/hadoop/conf/hadoop-env.sh


Export JAVA_HOME=/JDK


Vim/hadoop/conf/core-site.xml

<property>

<name>hadoop.tmp.dir</name>

<value>/home/hadoop/tmp</value>

</property>

<property>

<name>fs.default.name</name>

<value>hdfs://namenode:9000</value>

</property>

Vim/hadoop/conf/mapred-site.xml

<property>

<name>mapred.job.tracker</name>

<value>namenode:9001</value>

</property>


Vim/hadoop/conf/hdfs-site.xml

<property>

<name>dfs.name.dir</name>

<value>/home/hadoop/name</value>

</property>

<property>

<name>dfs.data.dir</name>

<value>/home/hadoop/name</value>

</property>

<property>

<name>dfs.replication</name>

<value>2</value>


Vim/hadoop/conf/masters


192.168.137.100


Vim/hadoop/conf/slaves

192.168.137.101

192.168.137.102

192.168.137.103


Copy the configured Hadoop to Datanode.

CD/

Scp-r Hadoop Datanode1:/hadoop

Scp-r Hadoop Datanode2:/hadoop

Scp-r Hadoop Datanode3:/hadoop


6, Installation Zookeeper

Tar zxvf Zookeeper-3.3.4.tar

Installed in/zookeeper

Cd/zookeeper/conf

CP Zoo_sample.cfg Zoo.cfg

Vim Zoo.cfg

Join

Datadir=/zookeeper-data

Datalogdir=/zookeeper-log

server.1=namenode:2888:3888

server.2=datanode1:2888:3888

server.3=datanode2:2888:3888

server.4=datanode3:2888:3888

Establish/zookeeper-data

Mkdir/zookeeper-data

Establish/zookeeper-log

Create a file/zookeeper-data/myid

Vim/zookeeper-data/myid

1

(corresponds to write 2 in datanode1)

(Corresponds to write 3 in Datanode2)

(Corresponds to write 4 in datanode3)

10. Installing Hive

TARZXVF Hive-0.8.0.tar

To/hive

vim/hive/bin/hive-config.sh

Export Hadoop_home=/hadoop

Export path=. $HADOOP _home/bin: $PATH

Export Hive_home=/hive

Export path= $HIVE _home/bin: $PATH

Export JAVA_HOME=/JDK

Export JRE_HOME=/JDK/JRE

Export classpath=. $JAVA _home/lib: $JRE _home/lib: $CLASSPATH

Export path=. $JAVA _home/bin: $JRE _home/bin: $PATH

Vim/etc/bashrc

Export Hive_home=/hive

11. Start Hadoop

Format and start the system

Su Hadoop

Cd/usr/local/hadoop/bin

./hadoop Namenode-format

./start-dfs.sh

./start-mapred.sh

http://192.168.137.100:50070 View HDFs Namenode

http://192.168.137.100:50030 View MapReduce JOB trackers

http://192.168.137.101:5006 View the task TRACKER on the Datanode1

12. Related commands

Hadoop Fs-mkdir Direc

Hadoop Fs-ls

Hadoop FS-CP File:///tmp/test.file/user/hadoop/direc


Hadoop Installation 1.0 (simplified version)

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.