Hadoop错误3_Ubuntu SSH Connection timed out类问题原因及解决方法

37 篇文章 2 订阅

在Hadoop分布式环境配置的实验过程中,将公匙从Master节点传输到 Slave1 节点时,或者ssh Slave1节点时,可能会遇到以下的问题:


ssh: connect to host slave1 port 22: Connection timed out
lost connection


ssh: connect to host slave1 port 22: No route to host


查找相关资料,这个网页上给的解释最全面:

http://www.gossamer-threads.com/lists/openssh/users/35856


First, see if the Linux can SSH to itself. From some other connection or 
from the console, run ssh localhost 
This will confirm that the sshd is running and accepting connections. If 
it fails, you will know that the problem is on the Linux server. 

Then make sure that you do not have a firewall that is blocking an 
outbound connection on port 22 (normally). This might be a software 
firewall running on your Windows PC. Windows XP SP2 has a built-in 
firewall feature, but it is not supposed to block outbound connections, 
only inbound connections. Others, though, such as those that are part of 
Norton, Symantec, MacAfee, etc. security packages, can block outbound. If 
you find one of these in place, you should be able to a) open the port in 
question, b) authorize the program in question, or c) temporarily turn the 
thing off for testing (be sure to turn it back on). 

Finally, if the Windows PC has internet access, you could try connecting 
via SSH to someone over the internet. 


首先,检查系统能够SSH自己,这个用来判断SSHD是否运行,是否接受连接,如果失败,你能够知道问题出在Linux系统自身。

具体方:ssh localhost


然后,确保防火墙没有禁用22端口,尤其是,如果实验环境是Windows系统的电脑,更应该检查。一些系统默认关闭了一些端口,不允许外部连接,如果你发现问题出在这里,打开端口。

具体方法:Ubuntu系统,sudo ufw allow 22


最后,如果电脑联网了,可以尝试使用SSH连接网络上的其他人,以此判断SSH是否能够正常工作。

除此之外,还应该保证主机和IP地址的映射关系正确,因为虚拟机重启后,IP地址可能会发生变化。

具体方法:Ubuntu系统,sudo vim /etc/hosts查看映射关系 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值