关于Hadoop启动时报错masternode:ssh: connect to host master port 22: Connection timed out问题的总结

关于Hadoop启动时报错masternode:ssh: connect to host master port 22: Connection timed out问题的总结

在这里插入图片描述
最近在Win10系统上配置了ubuntu-18.04.3,在配置集群的ssh无秘钥登录时,经常能碰到ssh: connect to host master port 22: Connection timed out的问题。
在这里插入图片描述
现在对该问题做一下可能出现的问题的总结和解决办法:

1、IP配置错误
当出现上述错误时,首先检查网络连通情况,Ping一下远程登录的目标主机,如果ping不通,很有可能是/etc/hosts文件中的IP地址映射出现问题,需要仔细检查名称和IP地址的映射关系。
映射关系一定要配置成功:
在这里插入图片描述
Ping一下,数据包没有丢失,说明没有问题:
在这里插入图片描述
2、防火墙问题
当发现IP配置没有错误时,我们需要检查端口是否被防火墙禁用了,使用sudo service iptables status命令查看防火墙状态,如果出现:
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 DROP tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080
2 DROP tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
3 DROP tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
我们可以看到,ssh登陆的默认端口22被禁止了。
我们使用sudo chkconfig iptables off来永久关闭防火墙,如果使用sudo service iptables stop将临时关闭防火墙,会在下一次关机重启后重置,建议使用第一种。

猜你喜欢

转载自blog.csdn.net/qq_22695001/article/details/103111072