Install hadoop 13.04 in standalone mode in Ubuntu

Source: Internet
Author: User

I. Installing Ubuntu 13.04 on virtual machines
 
If you are familiar with the English version, you can install the English version directly.
Download and install the system from the official website, which is not the focus of this article. Note: before installing a new user, remember to disconnect the network because the network is downloaded during the installation process. By default, the server in the United States is connected. If the network speed is slow, this step may take several hours. After the network is disconnected, the system will automatically skip this step. After the installation is complete, set the server and select the domestic server to update the Language Pack and other software.

Ii. Install JDK 1.7.0 _ 45
 
Download jdk-7u45-linux-x64.tar.gz from the oracleofficial network and run the following command:
 
1. cd/usr/(Note: Enter the usr directory)

2. sudo mkdir/usr/java (Note: Create a java directory under usr)

3. sudo cp/home/jimmy/Downloads/jdk-7u45-linux-x64.tar.gz/usr/java/(Note: Move the downloaded jdk compressed file to/usr/java, here, jimmy is the ubuntu user name. Here, we change it to our user name based on the actual situation)

4. sudo tar-zxf jdk-7u45-linux-x64.tar.gz (Note: extract)

5. sudo gedit ~ /. Bashrc (Note: Modify the bashrc file in the root directory to set java environment variables)

Append the following content to bashrc:
 
Export JAVA_HOME =/usr/java/jdk1.7.0 _ 45

Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

Export PATH = $ PATH: $ JAVA_HOME/bin
 
6. Close the current terminal window and open another terminal window (to make the environment variable take effect)
 
7. Verify that java is correctly installed
 
Enter the name: java-version
 
If the java version is correctly displayed, it indicates that the java environment already has
 
Input name: echo $ JAVA_HOME
 
If the JAVA_HOME path is correctly displayed, the environment variable is normal.

3. install openssh-server
 
Name: sudo apt-get install openssh-server
 
(Note: Standalone mode can be omitted)

4. Install Hadoop 1.2.1 stable version

1. Create a hadoop directory first

Mkdir hadoop
 
2. Move the downloaded hadoop package to the directory you just created.
 
Sudo cp/home/jimmy/Downloads/hadoop-1.2.1.tar.gz hadoop
 
3. Decompress
 
Cd hadoop
 
Sudo tar-zxf hadoop-1.2.1.tar.gz
 
By default, it is extracted to the hadoop \ hadoop-1.2.1 directory
 
4. Modify hadoop Environment Variables
 
Sudo chown-R jimmy hadoop-1.2.1 (first get the read and write permissions for the hadoop-1.2.1, Here jimmy is replaced with his own user name)
 
Gedit hadoop-1.2.1/conf/hadoop-env.sh (edit configuration file under conf)

Find the line # export JAVA_HOME, remove the comment, and change it to the correct path, that is:
 
# The java implementation to use. Required.

Export JAVA_HOME =/usr/java/jdk1.7.0 _ 45
 
5. Verify that hadoop runs properly
 
Cd hadoop-1.2.1
 
Bin/hadoop version
 
Normally, the version of hadoop is displayed.
 
6. Run the wordcount sample program.
 
Mkdir input (create input directory first)

Cp conf/* input (copy all files under conf to the input directory)

Bin/hadoop jar hadoop-example-1.2.1.jar wordcount input output (run the wordcount program and write the results to the output directory)

Cat output/* (view output results)

Note: The above operations are also applicable to mac OS and cent OS, but pay attention to some details.
 
On mac OS, the JAVA_HOME path is/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home.

If you cannot find the java directory, but the java-version displays the java version normally, you can execute export JAVA_HOME = '/usr/libexec/java_home' first'
 
Then echo $ JAVA_HOME to see the current jdk path.
 
Change the apt-get command on cent OS to yum.
 
Check whether the 64-bit message is displayed on cent OS: getconf LONG_BIT.

Hadoop cluster configuration, refer

Build a Hadoop environment on Ubuntu 13.04

Cluster configuration for Ubuntu 12.10 + Hadoop 1.2.1

Build a Hadoop environment on Ubuntu (standalone mode + pseudo Distribution Mode)

Configuration of Hadoop environment in Ubuntu

Detailed tutorial on creating a Hadoop environment for standalone Edition

Build a Hadoop environment (using virtual machines to build two Ubuntu systems in a Winodws environment)

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.