单节点Hadoop安装过程(2)

[Hadoop@master ~]$ cat ~/.ssh/id_rsa.pub  >> ~/.ssh/authorized_keys

[hadoop@master ~]$ chmod 700 ~/.ssh

[hadoop@master ~]$ chmod 600 ~/.ssh/authorized_keys

●  测试

[hadoop@master jdk1.6.0_25]$ ssh master.hadoop

Last login: Wed Jun 13 18:29:29 2012 from master.hadoop

1.1.4  Hadoop安装与配置
使用的Hadoop版本是hadoop-0.20.2.tar.gz,下载地址为:

● Hadoop安装

[root@master home]# tar xzvf hadoop-0.20.2.tar.gz

[root@master home]# mv hadoop-0.20.2 /usr/local

[root@master home]# cd /usr/local

[root@master local]# ls

bin  etc  games  hadoop-0.20.2  include  lib  lib64  libexec  sbin  share  src

[root@master local]# mv hadoop-0.20.2/ hadoop

[root@master local]# ls

bin  etc  games  hadoop  include  lib  lib64  libexec  sbin  share  src

[root@master local]# chown -R hadoop:hadoop /usr/local/hadoop/ #修改权限

● 环境变量配置

跟配置JAVA一样配置hadoop环境变量,编辑文件/etc/profile,同时也要修改hadoop内部环境变量/hadoop/conf/hadoop_env.sh,具体细节如下所示:

[root@master local]# vi /etc/profile

HADOOP_HOME=/usr/local/hadoop

HADOOP_CONF_DIR=$HADOOP_HOME/conf

CLASSPAH=.:$JAVA_HOME/lib:$HADOOP_HOME/lib

PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$HADOOP_HOME/bin

"/etc/profile" 73L, 1660C written                               

[root@master local]# source /etc/profile

[root@master conf]# vi hadoop-env.sh

export JAVA_HOME=$JAVA_HOME
 export HADOOP_CLASSPATH="$HADOOP_CLASSPATH"
 export HADOOP_HEAPSIZE=2048
 export HADOOP_LOG_DIR=/var/local/logs
 export HADOOP_PID_DIR=/var/local/pids

[root@master bin]# export JAVA_HOME

[root@master bin]# export HADOOP_HOME

[root@master bin]# export HADOOP_CONF_DIR

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/4d625c64cd73c025672f483563ab44d4.html