1. 准备工具
1. Vmware 12
2. Centeros6.5mini
3. Xshell 5
2. 复制4份虚拟机文件为别为node1 , node2 , node3 , node4 (删除.lck文件)
3. 分别配置4份虚拟机的ip.使得Windows中可以通过xshell等软件可以远程连接
4. 加入4条hosts 内容如下:
192.168.24.129 node1
192.168.24.130 node2
192.168.24.131 node3
192.168.24.132 node4
5. 设置node1免密码登录:
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa //生成私钥和公钥
cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys //将公钥放到认证文件中,以便免密码登录
6. 将node1的公钥通过命令scp到其他3个node的/opt/文件中
[root@node1 ~]# cd ~/.ssh
[root@node1 .ssh]# scp ./id_dsa.pub root@node3:/opt/
The authenticity of host 'node3 (192.168.24.131)' can't beestablished.
RSA key fingerprint is2f:ba:ba:42:46:f8:fb:f8:ed:34:1c:79:4e:83:e7:3f.
Are you sure you want to continue connecting (yes/no)? yes
7. 分别将其他3个node的公钥文件放到配置文件中
cd /opt
cat id_dsa.pub>> ~/.ssh/authorized_keys
搭建的几个linux作用如下: