本文介绍安装Hadoop 2.2.0 single node。 首先准备一个虚拟机,Ubuntu 12.04.4 Java环境:
1.root@hm1:~# mvn --version
2.Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 15:22:22+0000)
3.Maven home: /usr/apache-maven-3.1.1
4.Java version: 1.7.0_51, vendor: Oracle Corporation
5.Java home: /usr/lib/jvm/java-7-oracle/jre
6.Default locale: en_US, platform encoding: UTF-8
7.OS name: "linux", version: "3.2.0-59-virtual", arch: "amd64", family: "unix"
安装过程参考了 http://codesfusion.blogspot.com/2013/10/setup-hadoop-2x-220-on-ubuntu.html?m=1
01.root@hm1:~# addgroup hadoop
02.Adding group `hadoop' (GID 1001) ...
03.Done.
04.root@hm1:~# adduser --ingroup hadoop hduser
05.Adding user `hduser' ...
06.Adding new user `hduser' (1001) with group `hadoop' ...
07.Creating home directory `/home/hduser' ...
08.Copying files from `/etc/skel' ...
09.Enter new UNIX password:
10.Retype new UNIX password:
11.passwd: password updated successfully
12.Changing the user information for hduser
13.Enter the new value, or press ENTER for the default
14.Full Name []:
15.Room Number []:
16.Work Phone []:
17.Home Phone []:
18.Other []:
19.Is the information correct? [Y/n] y
添加到sudo组中
1.root@hm1:~# adduser hduser sudo
2.Adding user `hduser' to group `sudo' ...
3.Adding user hduser to group sudo
4.Done.
为了防止以后用hduser使用sudo时候遇到如下错误:
1.hduser is not in the sudoers file. This incident will be reported.
1.# Uncomment to allow members of group sudo to not need a password
2.# %sudo ALL=NOPASSWD: ALL
3.hduser ALL=(ALL) ALL
退出root用户,用hduser登录。
1.ssh hduser@192.168.1.70
为了避免安装脚本提示认证,下面的命令将建立localhost访问的证书文件
01.hduser@hm1:~$ ssh-keygen -t rsa -P ''
02.Generating public/private rsa key pair.
03.Enter file in which to save the key (/home/hduser/.ssh/id_rsa):
04.Created directory '/home/hduser/.ssh'.
05.Your identification has been saved in /home/hduser/.ssh/id_rsa.
06.Your public key has been saved in /home/hduser/.ssh/id_rsa.pub.
07.The key fingerprint is:
08.b8:b6:3d:c2:24:1f:7b:a3:00:88:72:86:76:5a:d8:c2 hduser@hm1
09.The key's randomart image is:
10.+--[ RSA 2048]----+
11.| |
12.| |
13.| |
14.|ooo . |
15.|=E++ . S |
16.|oo=.. o. |
17.| . .=oo |
18.| o=o+ |
19.| o+.o |
20.+-----------------+
21.hduser@hm1:~$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
22.hduser@hm1:~$ ssh localhost
23.The authenticity of host 'localhost (127.0.0.1)' can't be established.
24.ECDSA key fingerprint is fb:a8:6c:4c:51:57:b2:6d:36:b2:9c:62:94:30:40:a7.
25.Are you sure you want to continue connecting (yes/no)? yes
26.Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
27.Welcome to Ubuntu 12.04.4 LTS (GNU/<a href="http://www.it165.net/os/oslin/"target="_blank" class="keylink">Linux</a> 3.2.0-59-virtual x86_64)
28.
29.* Documentation: https://help.ubuntu.com/
30.Last login: Fri Feb 21 07:59:05 2014 from 192.168.1.5
现在下载hadoop,下载网址:http://apache.mirrors.lucidnetworks.net/hadoop/common/ 现在运行下面的命令下载和修改文件权限
1.$ cd ~
2.$ wget http://www.trieuvan.com/apache/hadoop/common/hadoop-2.2.0/hadoop-2.2.0.tar.gz
3.$ sudo tar vxzf hadoop-2.2.0.tar.gz -C /usr/local
4.$ cd /usr/local
5.$ sudo mv hadoop-2.2.0 hadoop
6.$ sudo chown -R hduser:hadoop hadoop
(责任编辑:IT) |