1.配置好hadoop集群 hadoop2 hadoop3 hadoop4
【max@hadoop2 .ssh】$ ssh-keygen -t rsa
敲三下回车,生成两个文件 id_rsa(私钥) id_rsa.pub(公钥)
2.将hadoop102公钥拷贝到要免密登录的目标机器上
【max@hadoop2 .ssh】$ ssh-copy-id hadoop102
【max@hadoop2 .ssh】$ ssh-copy-id hadoop103
【max@hadoop2 .ssh】$ ssh-copy-id hadoop104
3.hadoop103上生成公钥和私钥
【max@hadoop3 .ssh】$ ssh-copy-id hadoop102
【max@hadoop3 .ssh】$ ssh-copy-id hadoop103
【max@hadoop3 .ssh】$ ssh-copy-id hadoop104