在Linux(Ubuntu)上安装Hadoop,ubuntuhadoop
1. 安装 SSH
hadoop使用ssh进行通信,需要为ssh配置免密码登录
$ apt-get install ssh
$ ssh-keygen -t rsa -P ” -f ~/.ssh/id_rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh localhost
验证安装成功:
$ ssh -version
显示结果:
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
Bad escape character ‘rsion’.
验证无密码登录:
$ ssh localhost
显示结果:
Linux ubuntu 2.6.31-14-generic
…
Last login: Sun Jun 5 15:40:06 2011 from localhost
2. 安装JDK
#下载jdk后,先修改权限
chenwq@ubuntu:~/Downloads$ chmod 777 jdk-6u27-linux-x64.bin
#执行
./jdk-6u27-linux-x64.bin
3. 安装Hadoop
下载Hadoop最新版本: http://hadoop.apache.org/common/releases.html
下载然后解压
$ tar zxvf hadoop-0.20.0.tar.gz
4. 创建一个指向Hadoop的安装目录的环境变量:
chenwq@ubuntu:/$ export HADOOP_INSTALL=/home/chenwq/Downloads/hadoop
chenwq@ubuntu:/$ export PATH=$PATH:$HADOOP_INSTALL/bin
5. 检查Hadoop的运行
chenwq@ubuntu:/$ hadoop version
Hadoop 0.21.0
Subversion https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.21 -r 985326
Compiled by tomwhite on Tue Aug 17 01:02:28 EDT 2010
From source with checksum a1aeb15b4854808d152989ba76f90fac