hosts的设置如下
[root@hadoop01 hadoop-2.7.7]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.216.111 hadoop01
192.168.216.112 hadoop02
192.168.216.113 hadoop03
在主机 输入ssh-keygen -t rsa,然后一直enter
[root@hadoop01 hadoop-2.7.7]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
f2:b0:40:7f:38:b4:29:d0:05:91:51:05:93:a3:97:e5 root@hadoop01
The key's randomart image is:
+--[ RSA 2048]----+
| +*=+.