启动集群journalnode时节点启动失败出现The authenticity of host 映射名(xxx.xxx.xxx.xxx)' can't be established.的问题

启动集群journalnode时节点启动失败出现The authenticity of host 映射名(xxx.xxx.xxx.xxx)’ can’t be established.的问题

环境:笔者用的是hadoop-cdh-2.6.0
三台虚拟机分别是
hadoop001:10.0.0.187
hadoop002:10.0.0.185
hadoop003:10.0.0.186

今天配置完高可用的hadoop集群后,在启动journalnode时,发现我的hadopp001启动失败,报错是这样的

sh hadoop-daemons.sh journalnode
Usage: hadoop-daemons.sh [--config confdir] [--hosts hostlistfile] [start|stop] command args...
[hadoop@hadoop001 sbin]$ sh hadoop-daemons.sh start journalnode
The authenticity of host 'hadoop001 (10.0.0.187)' can't be established.
RSA key fingerprint is de:44:de:ee:0e:02:9c:2b:73:99:94:2c:af:4a:8a:ad.
Are you sure you want to continue connecting (yes/no)? hadoop002: starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-hadoop002.out
hadoop003: starting journalnode, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/logs/hadoop-hadoop-journalnode-hadoop003.out

hadoop001: Host key verification failed.

我配置高可用的hadoop集群在实现高可用时需要配置这两项

  
      
             dfs.ha.fencing.methods  
             sshfence  
      
      
      
            dfs.ha.fencing.ssh.private-key-files  
            /root/.ssh/id_rsa  
     

而在启动journalnode时需要ssh登陆且没有交互,启动失败可能是本地主机的key发生了变化,如果在SSH链接时都会有提示,只需要在交互下输入yes即可。但是现在的话没有交互
于是提出解决方案,关闭主机公钥检查功能
SSH 连接远程主机时,会检查主机的公钥。如果是第一次该主机,会显示该主机的公钥摘要,提示用户是否信任该主机:

The authenticity of host '192.168.0.110 (192.168.0.110)' can't be established.
RSA key fingerprint is a3:ca:ad:95:a1:45:d2:57:3a:e9:e7:75:a8:4c:1f:9f.
Are you sure you want to continue connecting (yes/no)?

当选择接受,就会将该主机的公钥追加到文件 ~/.ssh/known_hosts 中。当再次连接该主机时,就不会再提示该问题了。 如果因为某种原因(服务器系统重装,服务器间IP地址交换,DHCP,虚拟机重建,中间人劫持),该IP地址的公钥改变了,当使用 SSH 连接的时候,会报错
于是执行以下脚本关闭共钥检查
执行ssh -o StrictHostKeyChecking=no yyy.yyy.yyy.yyy,就可以了。yyy.yyy.yyy.yyy是本地机器的IP地址

你可能感兴趣的:(启动集群journalnode时节点启动失败出现The authenticity of host 映射名(xxx.xxx.xxx.xxx)' can't be established.的问题)