2.1 jdk安装
1.在/usr/目录下创建java目录
[root@localhost ~]# mkdir/opt/java
[root@localhost ~]# cd /opt/java
2.下载jdk,然后解压
[root@localhost java]# curl -O http://download.Oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
[root@localhost java]# tar -zxvf jdk-7u79-linux-x64.tar.gz -C /opt/java
3.设置环境变量
[root@localhost java]# vi /etc/profile
在profile中添加如下内容:
#set java environment
export JAVA_HOME=/opt/java/jdk1.7.0_79
PATH=$JAVA_HOME/bin:$PATH
让修改生效:
[root@localhost java]# source /etc/profile
4.验证JDK有效性
[root@localhost java]# 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)
2.2 ssh安装
CentOS 6.5配置SSH免密码登录
创建新用户:useradd Hadoop
设置密码:passwd hadoop,输入自己想要的密码即可,之后su hadoop切换用户
修改主机名:vim /etc/sysconfig/network,加入hostname master,注销系统之后即可看到修改成功
修改hosts文件:vim/etc/hosts 192.168.56.101 master 192.168.56.102 slave1
ssh免登录,查看ssh:
[hadoop@master ~]$ rpm -qa|grep ssh
openssh-server-5.3p1-94.el6.x86_64
libssh2-1.4.2-1.el6.x86_64
openssh-clients-5.3p1-94.el6.x86_64
openssh-5.3p1-94.el6.x86_64
openssh-askpass-5.3p1-94.el6.x86_64
发现我已经都安装了,如果有没安装的,那么使用yum install ssh(缺少的即可)
修改/etc/ssh/sshd_configRSAAuthentication yesPubkeyAuthentication yesAuthorizedKeysFile .ssh/authorized_keys
启用这三行,然后重启service sshd restart