单节点运行 hadoop 环境配置
一、配置 java 环境
我是用的是稳定的 1.6 版本,1.6.32。下载地址
http://www.Oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.ht
ml
下载 jdk-6u32-linux-i586.bin 版本。Linux 下安装 bin 文件命令:=
(1)移动到自己安装 JDK 的路径,我的路径是:/home/wy/jdk 下,没有的文件夹自己创建;
(2)chmod +x jdk-6u32-linux-i586.bin
(3)./jdk-6u32-linux-i586.bin
安装完成然后配置环境变量,修改/etc/profile
export JAVA_HOME=/home/wy/jdk/jdk1.6.0_32
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export JAVA_HOME JRE_HOME CLASSPATH PATH
注销,重新登录
使用 java -version 查看版本是否一样,安装正确?
写一个 helloworld.java 测试一下
public class helloworld.java{
public static void main(String []args){
System.out.println("Hello,wolrd!");
}
}
二、安装 ssh
终端下使用下面的命令:
First, we have to generate an SSH key for the user:
ssh-keygen -t rsa -P ""
Second, you have to enable SSH access to your local machine with this newly created key.
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
The final step is to test the SSH setup by connecting to your local machine with the user。
ssh localhost (测试是否成功)
遇到问题一般都是:
Failed to add the host to the list of known_hosts
解决方案如下:命令行下直接执行
chown wy /home/ wy /.ssh