cp id_rsa
.pub authorized_keys_Worker1
cp id_rsa
.pub authorized_keys_Worker2
cp id_rsa
.pub authorized_keys_Worker3
cp id_rsa
.pub authorized_keys_Worker4
6.4 把从节点(Worker)的公钥拷贝到主节点(Master)的.ssh目录下
scp authorized_keys_Worker1 hjr
@Master:/home/hjr/.ssh
scp authorized_keys_Worker2 hjr
@Master:/home/hjr/.ssh
scp authorized_keys_Worker3 hjr
@Master:/home/hjr/.ssh
scp authorized_keys_Worker4 hjr
@Master:/home/hjr/.ssh
最后在Master的.ssh目录下面查看以下:
6.5 将所有节点的公钥信息保存到主节点下的authorized_keys(新生成的)文件中
cat authorized_keys_Master >> authorized_keys
cat authorized_keys_Worker1 >> authorized_keys
cat authorized_keys_Worker2 >> authorized_keys
cat authorized_keys_Worker3 >> authorized_keys
cat authorized_keys_Worker4 >> authorized_keys
查看一下authorized_keys文件内容:
6.6 把authorized_keys文件拷贝到从节点上去
scp authorized_keys hjr
@Worker1:/home/hjr/.ssh
scp authorized_keys hjr
@Worker2:/home/hjr/.ssh
scp authorized_keys hjr
@Worker3:/home/hjr/.ssh
scp authorized_keys hjr
@Worker4:/home/hjr/.ssh
6.7 设置.SSH 目录权限
设置
.ssh目录权限 : chmod
700 -R
.ssh
6.8 测试SSH
(这样Master和各个Worker之间就能够相互通信了—Master可以通过ssh连接到Worker1,Worker2,Worker3,Worker4; Worker1,Worker2,Worker3,Worker4可以通过ssh连接到Master)
7 MySQL 5.6.4安装(可选)
7.1 检查MySQL及相关RPM包,是否安装,如果有安装,则移除
7.2 下载MySQL包:MySQL-5.6.34-1.linux_glibc2.5.x86_64.rpm-bundle.tar
7.3 解压