1,查看操作系统版本
[hadoop@vm172-31-64-34 ~]$ cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)
2,主机规划
172.31.64.33 master
172.31.64.34 slave1
172.31.64.12 slave2
3,创建hadoop用户
登录各主机,执行
useradd hadoop
passwd hadoop
4,免密登录
在master上执行
ssh-keygen
一路回车
ssh-copy-id hadoop@172.31.64.34
ssh-copy-id hadoop@172.31.64.12
5,java安装
登录个主机执行
yum install java
查看openjdk安装路径
[root@vm172-31-64-34 ~]# rpm -qa | grep openjdk
java-1.8.0-openjdk-headless-1.8.0.151-5.b12.el7_4.x86_64
java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64
[root@vm172-31-64-34 ~]# rpm -ql java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre/bin/policytool
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre/lib/amd64/libawt_xawt.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre/lib/amd64/libjawt.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre/lib/amd64/libjsoundalsa.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre/lib/amd64/libsplashscreen.so
/usr/share/applications/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64-policytool.desktop
配置环境变量
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64
export JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre
export CLASSPATH=.:${CLASSPATH}:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${PATH}:${JAVA_HOME}/bin:${JRE_HOME}/bin