1.添加用户
2.安装SSH
apt-get install openssh-server
启动SSH
/etc/init.d/ssh start
查看SSH是否启动
ps -e | grep ssh
生成密钥
ssh-keygen -t rsa -P ""
加入密钥
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
登陆SSH
ssh localhost
3.安装Java
apt-get install openjdk-6-jdk
java -version
4.安装hadoop
http://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/
chown -R hadoop:hadoop(此为用户,尽量一直用此用户操作) /usr/local/hadoop
5.设定hadoop-env.sh(Java 安装路径)
进入hadoop目录,打开conf目录下到hadoop-env.sh,添加以下信息:
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk (视你机器的java安装路径而定)
export HADOOP_HOME=/usr/local/hadoop (视安装目录)
export PATH=$PATH:/usr/local/hadoop/bin (视安装目录)
配置生效
source /usr/local/hadoop/conf/hadoop-env.sh
6.测试
在根目录创建 mkdir input
拷贝conf下所有文件到input sudo cp conf/* input
执行 bin/hadoop jar hadoop-0.20.2-examples.jar wordcount input output
显示结果 cat output/*