服务器无法找到到 api.twitter.com 的路由

服务器无法找到到 api.twitter.com 的路由

5 分钟前,我的服务器无法找到通往 api.twitter.com 的路由。mtr显示空白屏幕。/etc/init.d/networking restart问题已修复,但我想了解问题出在哪里,以便下次更准确地排除故障。有什么想法吗?

更新:这是主机命令shows

host api.twitter.com
api.twitter.com has address 199.16.156.199
api.twitter.com has address 199.16.156.40
api.twitter.com has address 199.16.156.104

刷新缓存后,一条路线发生变化:

host api.twitter.com
api.twitter.com has address 199.16.156.40
api.twitter.com has address 199.16.156.104
api.twitter.com has address 199.16.156.231

答案1

如你所见,api.twitter.com 有多个 A 记录

# host api.twitter.com 216.187.125.130
Using domain server:
Name: 216.187.125.130
Address: 216.187.125.130#53
Aliases:

api.twitter.com has address 199.59.150.9
api.twitter.com has address 199.59.149.199
api.twitter.com has address 199.59.149.232

# host api.twitter.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:

api.twitter.com has address 199.16.156.199
api.twitter.com has address 199.16.156.72
api.twitter.com has address 199.16.156.231

因此,有可能“集群”中的一个节点发生故障,所有数据包都试图到达故障节点。如您所见,每条路由都有 TTL

# ip ro get 199.59.150.9
199.59.150.9 via 209.15.xxx.xxx dev em1  src 209.15.xxx.xxx
    cache  mtu 1500 advmss 1460 hoplimit 64

# ip -s route show cache 199.16.156.231
199.59.150.9 via 209.15.xxx.xxx dev em1  src 192.168.207.10
    cache  users 1 used 38 age 17sec ipid 0x7f34 mtu 1500 advmss 1460 hoplimit 64
199.59.150.9 from 209.15.xxx.xxx via 209.15.xxx.xxx dev em1
    cache  users 1 age 20sec mtu 1500 advmss 1460 hoplimit 64

我认为您可以使用以下命令来清理缓存

# ip route flush cache 199.59.150.9

您可以在以下位置获取更多信息http://vincent.bernat.im/en/blog/2011-ipv4-route-cache-linux.html

相关内容