hadoop的Linux下简单安装步骤

13-08-26 banq
    

首先安装Hadoop cluster版本:

$ curl -O http://archive.cloudera.com/cdh/3/hadoop-0.20.2-cdh3u6.tar.gz

$ cd /usr/local

$ tar xzvf /path/to/hadoop-0.20.2-cdh3u6.tar.gz

$ ln -s hadoop-0.20.2-cdh3u6 hadoop

配置工作:

$ cd hadoop

$ mv conf conf.original

$ cp -Rp example-confs/conf.pseudo conf

将/usr/local/hadoop/bin加入PATH环境

$ export PATH=/usr/local/hadoop/bin:$PATH

格式化HDFS

建立临时文件目录 /var/lib/hadoop-0.20/

chmod 0777 -R /var/lib/hadoop-0.20/

chmod 0777 -R /usr/local/hadoop/

以普通用户登录,非ROOT用户,然后运行:

hadoop namenode -format

出现:O common.Storage: Storage directory /var/lib/hadoop-0.20/cache/hadoop/dfs/name has been successfully formatted.

表示OK。

分别运行:

$ hadoop namenode

$ hadoop datanode

$ hadoop jobtracker

$ hadoop tasktracker