AWS中的网络连接超时

时间:2015-12-07 08:25:50

标签: amazon-web-services ssh amazon-ec2 aws-security-group

即使凭据/ ssh密钥和安全组/防火墙设置正确,间歇性获取ssh /网络连接错误。

SSH Error: ssh: connect to host 10.0.X.x port 22: Connection timed out while connecting to 10.0.X.X:22

1 个答案:

答案 0 :(得分:0)

在AWS环境中,自动缩放发生得非常频繁,有时IP会被其他服务重用。当源服务器仍然缓存ARP表中的旧目标IP服务器/实例MAC地址时,您将收到连接错误。因此,连接将失败,因为新目标服务器的MAC地址与ARP表中缓存的MAC地址不匹配。

临时修复:

sudo sysctl -w net.ipv4.neigh.default.gc_thresh1=0

永久修复:

sudo vi /etc/sysctl.conf
net.ipv4.neigh.default.gc_thresh1 = 0
reboot
相关问题