Hadoop--3.JDK1.7安装配置
一、下载JDK
JDK1.7下载:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
二、安装
1.修改文件名
[root@master src]# mv jdk-7u79-linux-x64.tar.gz\?AuthParam\=1473757361_a54f9f6441c4d0741a68b813b6ab1041 jdk-7u79-linux-x64.tar.gz
2.解压文件
[root@master src]# tar zxvf jdk-7u79-linux-x64.tar.gz
3.移动文件
[root@master src]# mv jdk1.7.0_79 /usr/local/
三、配置环境变量
1.编辑文件
[root@slave1 local]# vim /etc/profile.d/java.sh
添加以下内容:
#!/etc/sbin/bash export JAVA_HOME=/usr/local/jdk1.7.0_79 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin |
2.刷新文件
[root@slave1 local]# source /etc/profile.d/java.sh
3.查看(java版本不对执行以下操作)
[root@master ~]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
4.查看已安装java
[root@master ~]# yum list |grep java
[root@master ~]# rpm -qa |grep java
5.卸载java
[root@master ~]# yum remove java-1.6.0-openjdk* java-1.7.0-openjdk*java-1.8.0-openjdk*
四、所有slave安装JDK
1.传送jdk所有slave
[root@master src]# rsync -av /usr/local/jdk1.7.0_79 slave1:/usr/local/
[root@master src]# rsync -av /usr/local/jdk1.7.0_79 slave2:/usr/local/
[root@master src]# rsync -av /usr/local/jdk1.7.0_79 slave3:/usr/local/
[root@master src]# rsync -av /usr/local/jdk1.7.0_79 slave4:/usr/local/
[root@master src]# rsync -av /usr/local/jdk1.7.0_79 slave5:/usr/local/
[root@master src]# rsync -av /usr/local/jdk1.7.0_79 slave6:/usr/local/
2.编辑配置文件
跟上面的操作一样