配置主机互信:
$ ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ''
将节点主机信息添加到本地,防止提醒
for host in 192.168.200.{27..33};do
ssh-keyscan $host >>~/.ssh/known_hosts 2>/dev/null
done
# sshpass -p选项指定的是密码
for host in 192.168.200.{27..33};do
sshpass -p'123456' ssh-copy-id root@$host &>/dev/null
done