这是网络问题还是服务器崩溃?无法 ping 通时如何确定真正的问题是什么?

这是网络问题还是服务器崩溃?无法 ping 通时如何确定真正的问题是什么?

今天我无法远程 ping 我的服务器(CentOS 5.4,在戴尔电脑上)。然后我尝试了 traceroute,结果显示目标主机无法访问。这非常令人困惑,因为它不应该出现这种情况。

当现场有人重新启动它时,我就能再次登录了。我意识到有问题,但仍然无法确定根本原因。

以下是详细信息:

  1. ISP 使用服务器的 MAC 地址通过 DHCP 自动为其分配静态 IP。
  2. 因此服务器处于自动 DHCP 模式

    • 我将其保留为 DHCP,因为 ISP 将根据 MA​​C 地址提供相同的 IP。
  3. 几个月来它一直运转良好。今天发生的事情是我以前从未见过的。

  4. 物理重启服务器后,它重新上线,我就可以再次登录了。

但我仍然不确定这是 DHCP 和静态 IP 问题还是 ISP 电缆问题,或者是 ISP 本身有问题?在这种情况下,您如何快速识别(或从日志中确定)导致这种情况的原因?

Aug  4 23:13:54 DellServer dhclient: bound to xx.xx.xx.1xx -- renewal in 3363 seconds.
Aug  5 00:09:57 DellServer dhclient: DHCPREQUEST on eth0 to xx.xx.137.3 port 67
Aug  5 00:09:57 DellServer dhclient: DHCPACK from xx.xx.137.3
Aug  5 00:09:57 DellServer dhclient: bound to xx.xx.xx.1xx -- renewal in 1823 seconds.
Aug  5 00:40:20 DellServer dhclient: DHCPREQUEST on eth0 to xx.xx.137.3 port 67
Aug  5 00:40:20 DellServer dhclient: DHCPACK from xx.xx.137.3
Aug  5 00:40:20 DellServer dhclient: bound to xx.xx.xx.1xx -- renewal in 3070 seconds.
Aug  5 00:59:42 DellServer auditd[2510]: Audit daemon rotating log files
Aug  5 01:31:30 DellServer dhclient: DHCPREQUEST on eth0 to xx.xx.137.3 port 67
Aug  5 01:31:30 DellServer dhclient: DHCPACK from xx.xx.137.3
Aug  5 01:31:30 DellServer dhclient: bound to xx.xx.xx.1xx -- renewal in 1658 seconds.
Aug  5 01:59:08 DellServer dhclient: DHCPREQUEST on eth0 to xx.xx.137.3 port 67
Aug  5 01:59:08 DellServer dhclient: DHCPACK from xx.xx.137.3
Aug  5 01:59:08 DellServer dhclient: bound to xx.xx.xx.1xx -- renewal in 2907 seconds.
Aug  5 02:47:35 DellServer dhclient: DHCPREQUEST on eth0 to xx.xx.137.3 port 67
Aug  5 02:47:35 DellServer dhclient: DHCPACK from xx.xx.137.3
Aug  5 02:47:35 DellServer dhclient: bound to xx.xx.xx.1xx -- renewal in 2060 seconds.
Aug  5 03:09:36 DellServer kernel: bnx2: eth0 NIC Copper Link is Down
Aug  5 03:09:38 DellServer kernel: bnx2: eth0 NIC Copper Link is Up, 1000 Mbps full duplex
Aug  5 03:21:55 DellServer dhclient: DHCPREQUEST on eth0 to xx.xx.137.3 port 67
Aug  5 03:22:29 DellServer last message repeated 3 times
Aug  5 03:23:34 DellServer last message repeated 5 times
Aug  5 03:24:36 DellServer last message repeated 5 times
Aug  5 03:25:39 DellServer last message repeated 5 times
Aug  5 03:26:53 DellServer last message repeated 6 times
Aug  5 03:27:59 DellServer last message repeated 5 times
Aug  5 03:29:04 DellServer last message repeated 5 times
Aug  5 03:30:10 DellServer last message repeated 5 times
Aug  5 03:31:13 DellServer last message repeated 5 times
Aug  5 03:32:21 DellServer last message repeated 4 times
Aug  5 03:33:27 DellServer last message repeated 4 times
Aug  5 03:34:38 DellServer last message repeated 5 times
Aug  5 03:35:39 DellServer last message repeated 4 times
Aug  5 03:36:49 DellServer last message repeated 4 times
Aug  5 03:37:50 DellServer last message repeated 4 times
Aug  5 03:38:56 DellServer last message repeated 4 times
Aug  5 03:39:58 DellServer last message repeated 4 times
Aug  5 03:41:13 DellServer last message repeated 4 times
Aug  5 03:42:20 DellServer last message repeated 5 times
Aug  5 03:43:40 DellServer last message repeated 5 times
Aug  5 03:44:50 DellServer last message repeated 4 times
Aug  5 03:45:51 DellServer last message repeated 4 times
Aug  5 03:47:02 DellServer last message repeated 4 times
Aug  5 03:48:07 DellServer last message repeated 6 times
Aug  5 03:49:19 DellServer last message repeated 6 times
Aug  5 03:50:08 DellServer last message repeated 4 times
Aug  5 03:50:23 DellServer dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Aug  5 03:50:58 DellServer last message repeated 3 times
Aug  5 03:52:13 DellServer last message repeated 4 times
Aug  5 03:53:18 DellServer last message repeated 5 times
Aug  5 03:54:27 DellServer last message repeated 6 times
Aug  5 03:55:41 DellServer last message repeated 6 times
Aug  5 03:56:48 DellServer last message repeated 4 times
Aug  5 03:57:54 DellServer last message repeated 5 times
Aug  5 03:59:03 DellServer last message repeated 5 times
Aug  5 03:59:09 DellServer NET[32604]: /sbin/dhclient-script : updated /etc/resolv.conf
Aug  5 03:59:09 DellServer avahi-daemon[3284]: Withdrawing address record for xx.xx.xx.1xx on eth0.
Aug  5 03:59:09 DellServer avahi-daemon[3284]: Leaving mDNS multicast group on interface eth0.IPv4 with address xx.xx.xx.1xx.
Aug  5 03:59:09 DellServer avahi-daemon[3284]: iface.c: interface_mdns_mcast_join() called but no local address available.
Aug  5 03:59:09 DellServer avahi-daemon[3284]: Interface eth0.IPv4 no longer relevant for mDNS.
Aug  5 03:59:09 DellServer kernel: bnx2: eth0: using MSIX
Aug  5 03:59:09 DellServer kernel: bnx2i: iSCSI not supported, dev=eth0
Aug  5 03:59:11 DellServer kernel: bnx2i: iSCSI not supported, dev=eth0
Aug  5 03:59:11 DellServer dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
Aug  5 03:59:11 DellServer dhclient: send_packet: Network is down
Aug  5 03:59:11 DellServer kernel: bnx2: eth0 NIC Copper Link is Up, 1000 Mbps full duplex
Aug  5 03:59:17 DellServer dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
Aug  5 03:59:31 DellServer dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
Aug  5 03:59:41 DellServer dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
Aug  5 03:59:53 DellServer dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
Aug  5 04:00:04 DellServer dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Aug  5 04:00:12 DellServer dhclient: No DHCPOFFERS received.
Aug  5 13:51:03 DellServer shutdown[1828]: shutting down for system halt
Aug  5 13:51:03 DellServer init: Switching to runlevel: 0
Aug  5 13:51:04 DellServer smartd[3426]: smartd received signal 15: Terminated 
Aug  5 13:51:04 DellServer smartd[3426]: smartd is exiting (exit status 0) 
Aug  5 13:51:04 DellServer avahi-daemon[3284]: Got SIGTERM, quitting.
Aug  5 13:51:07 DellServer xinetd[3026]: Exiting...
Aug  5 13:55:06 DellServer syslogd 1.4.1: restart.
Aug  5 13:55:06 DellServer kernel: klogd 1.4.1, log source = /proc/kmsg started.

答案1

以下是您的日志似乎显示的内容(至少对我来说):

链接断开后又恢复了。

您的 DHCP 客户端等待了很长时间才从 DHCP 服务器收到消息并取回其旧地址,但是它没有收到来自 DHCP 服务器的消息,因此它声明网络已关闭(即使链接已打开)。

然后,它进行了一些网络调整并再次尝试(可能从任何 DHCP 服务器请求任何 IP 地址),但再次未能发现 DHCP 服务器,因此此时它可能完全放弃了,等待有人修复它并重置网络连接(通过重新启动来完成;从操作系统内部重置 NIC 可能就足够了)。

由于我们不知道您的服务器网络端口和 ISP 之间存在什么硬件或配置,因此几乎不可能说出是什么发生了故障,尤其是仅基于(此)一份事件报告时。

建议:

  • 您的服务器的网络配置应该是硬设置的,而不是依赖于 DHCP。
  • 如果您想在没有干预的情况下保持较高的正常运行时间,您应该有自动重启(和故障转移)功能。

相关内容