- 准备工作
- 创建3台虚拟机
操作系统:CentOS release 6.4 (Final) JDK版本 :1.7.0_60 用户 :hadoop IP地址 :192.168.18.130、192.168.18.131、192.168.18.132
- 三台虚拟机开启ssh无密钥登录
1.创建用户组 groupadd -g 1002 bigdata 2.创建hadoop用户 useradd -g bigdata -u 1002 -m -d /home/hadoop hadoop passwd hadoop/hadoop 3.登录130,创建公钥和密钥 ssh-keygen -t rsa 4.公钥复制到131和132上 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.18.131 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.18.132 5.登录131,创建公钥和密钥 ssh-keygen -t rsa 6.公钥复制到130和132上 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.18.130 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.18.132 7.登录132,创建公钥和密钥 ssh-keygen -t rsa 8.公钥复制到130和131上 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.18.130 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.18.131
- 修改3台服务器的hosts文件
执行完上述步骤后,测试一下是否可以无密钥登录远程机器即可~vi /etc/hosts 192.168.18.130 master 192.168.18.131 slave1 192.168.18.132 slave2