启动hadoop时遇到Host key verification failed.

问题如下:

[root@namenode sbin]# start-dfs.sh
Starting namenodes on [NN]
The authenticity of host 'nn (192.168.4.16)' can't be established.
ECDSA key fingerprint is SHA256:+80GiOqSsCJkefY9527/CCs/MGqkBYsNpuLPSTCkJ7w.
ECDSA key fingerprint is MD5:cb:7c:80:72:5a:81:02:5f:08:2f:e5:59:a8:59:12:df.
Are you sure you want to continue connecting (yes/no)? yes
NN: Warning: Permanently added 'nn,192.168.4.16' (ECDSA) to the list of known hosts.
NN: starting namenode, logging to /home/loli/hadoop-2.6.0/logs/hadoop-root-namenode-namenode.out
The authenticity of host 'dn2 (192.168.4.63)' can't be established.
ECDSA key fingerprint is SHA256:+80GiOqSsCJkefY9527/CCs/MGqkBYsNpuLPSTCkJ7w.
ECDSA key fingerprint is MD5:cb:7c:80:72:5a:81:02:5f:08:2f:e5:59:a8:59:12:df.
Are you sure you want to continue connecting (yes/no)? The authenticity of host 'dn3 (192.168.4.73)' can't be established.
ECDSA key fingerprint is SHA256:+80GiOqSsCJkefY9527/CCs/MGqkBYsNpuLPSTCkJ7w.
ECDSA key fingerprint is MD5:cb:7c:80:72:5a:81:02:5f:08:2f:e5:59:a8:59:12:df.
Are you sure you want to continue connecting (yes/no)? DN1: starting datanode, logging to /home/loli/hadoop-2.6.0/logs/hadoop-root-datanode-namenode.out

DN2: Host key verification failed.

DN3: Host key verification failed.


Starting secondary namenodes [0.0.0.0]
The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established.
ECDSA key fingerprint is SHA256:+80GiOqSsCJkefY9527/CCs/MGqkBYsNpuLPSTCkJ7w.
ECDSA key fingerprint is MD5:cb:7c:80:72:5a:81:02:5f:08:2f:e5:59:a8:59:12:df.
Are you sure you want to continue connecting (yes/no)? 
0.0.0.0: Host key verification failed.

可以看到在hadoop启动namenode时遇到Host key verification failed. 出现问题的节点有datanode2,datanode3和namenode。

网上查找是因为ssh的known_hosts文件有问题,参考https://askubuntu.com/questions/45679/ssh-connection-problem-with-host-key-verification-failed-error

查看我的known_hosts文件:

[root@namenode .ssh]# cat known_hosts
192.168.4.48 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=
192.168.4.63 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=
192.168.4.73 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=
dn1 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=
nn,192.168.4.16 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=

照着成功启动的dn1格式进行修改:

dn2 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=
dn3 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=
dn1 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=
nn  ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4CvO8KUCwx3JfQ57GU+zoSLN04LCiznKVUObfA+S0tAaFTzqM7wVniSNYt7/9bXvWrxT7+0TWiVsoCWtz9QuA=

继续运行start-dfs.sh

DN1: datanode running as process 3345. Stop it first.
DN2: starting datanode, logging to /home/loli/hadoop-2.6.0/logs/hadoop-root-datanode-namenode.out
DN3: starting datanode, logging to /home/loli/hadoop-2.6.0/logs/hadoop-root-datanode-namenode.out
0.0.0.0: starting secondarynamenode, logging to /home/loli/hadoop-2.6.0/logs/hadoop-root-secondarynamenode-namenode.out

成功

你可能感兴趣的:(启动hadoop时遇到Host key verification failed.)