The original Article is from Lin yufei ubuntu version 12.04.364 where hadoop runs on a Java Virtual Machine. Therefore, you need to install jdk first. jdk installation and configuration methods should be prepared by installing jdk 1.7 source code package under another blog article ubuntu12.04: my download is hadoop-1.2.1.tar.gz. This version is relatively stable and you can go to the official website to provide the image w
The original Article is from the 64-bit hadoop of aliyunyang ubuntu version 12.04.3, which runs on a Java Virtual Machine. Therefore, you need to install jdk first, jdk installation and configuration method in another blog post ubuntu12.04 install jdk 1.7 source code package preparation: I download hadoop-1.2.1.tar.gz, which is relatively stable and can go to the official website to provide the image http: // w
Original article from Lin yufei
Ubuntu version 12.04.3 64-bit
Hadoop runs on a Java Virtual Machine. Therefore, you need to install jdk first. Install jdk 1.7 in another blog article titled ubuntu12.04.
Source code package preparation:
I download hadoop-1.2.1.tar.gz, this version is relatively stable, you can go to the official website to provide image http://www.apache.org/dyn/closer.cgi/hadoop/common/
1. Create a hadoop Administrator Account
Run the following command on the terminal:
1 sudo adduser hadoop
Then ask you to set the hadoop account password. This command is to add a standard account named hadoop. What we need is the administrator account.
You can directly modify the hadoop permissions in the graphic interface, click a person's header in the upper right corner, a list is displayed, click "User Account", unlock, and change to administrator permissions.
2. Install the ssh service
Ssh allows remote logon and management. For details, google Baidu
By default, the ssh service is not installed in ubuntu. If you connect to ubuntu through ssh, You need to manually Install ssh-server. Command line:
1 sudo apt-get install ssh openssh-server
3. ssh Login Without password verification
Create an ssh-key. Here we use the rsa method. The command line is as follows:
1 ssh-keygen -t rsa -P ""
When a graph appears, it is a password. You don't need to worry about it.
1 cat ~/.ssh/id_rsa.pub >> authorized_keys
Then you can log on without password verification, as shown below:
1 ssh localhost
Exit Command Behavior:
exit
4. decompress the hadoop source code package.
Enter the directory where the hadoop source code package is located in the terminal, and run the Copy command to copy the hadoop source code package to/home/hadoop.
1 cp hadoop-1.2.1.tar.gz /home/hadoop
Decompress the package and run the following command:
tar -xzvf *.tag.gz
5. Configure hadoop/conf under the hadoop-env.sh, core-site.xml, mapred-site.xml, hdfs-site.xml
Configure the hadoop-1.2.1/conf/hadoop-env.sh, command line:
1 gedit /home/hadoop/hadoop-1.2.1/conf/hadoop-env.sh
Ctrl + f search JAVA_HOME
Remove the previous # and add the jdk path of the system. Save and exit.
Configure the hadoop-1.2.1/conf/core-site.xml, command line:
gedit /home/hadoop/hadoop-1.2.1/conf/core-site.xml
Create the hadoop_tmp directory in hadoop because the http://blog.csdn.net/bychjzh/article/details/7830508
Set And save and exit.
fs.default.name
hdfs://localhost:9000
Configure the hadoop-1.2.1/conf/mapre-site.xml, command line:
1 gedit /home/hadoop/hadoop-1.2.1/conf/mapred-site.xml
Set And save and exit.
mapred.job.tracker
localhost:9001
Configure the hadoop-1.2.1/conf/hdfs-site.xml, command line:
1 gedit /home/hadoop/hadoop-1.2.1/conf/hdfs-site.xml
Set And save and exit.
dfs.replication
1
Now the hadoop installation and configuration have been completed, and later is the first operation of hadoop.
6. format the hdfs File System
Entering hadoop-1.2.1
/bin/hadoop namenode -format
When you see it
Congratulations, The hdsf file system is formatted successfully.
7. Start the hadoop Service
/bin/start-all.sh
The following figure is displayed:
jps
Jps is the java thread used to view the java virtual machine running.
The following figure is displayed:
Without jps, there are five hadoop-related threads. Congratulations! hadoop has been installed and configured successfully and runs normally.
Then you can exit hadoop ., Start later and import data
1 bin/stop-all.sh