服务器在三天后失去连接

服务器在三天后失去连接

我在使用 Ubuntu 20.04 服务器时遇到了一些问题,三天后就断开了连接。该服务器使用 Dracut 启动。它在启动并从 DHCP 服务器获取 IP 地址后,会停止 NetworkManager。我这样做是因为有人指出 NetworkManager 可能导致了这种情况。

我希望服务器保留启动后获得的 IP 地址。

root@host:/var/log# systemctl list-units --all '*etwork*'
  UNIT                               LOAD   ACTIVE   SUB     DESCRIPTION                           
  networkd-dispatcher.service        loaded active   running Dispatcher daemon for systemd-networkd
  NetworkManager-wait-online.service loaded inactive dead    Network Manager Wait Online           
  NetworkManager.service             loaded inactive dead    Network Manager                       
  systemd-networkd.service           loaded inactive dead    Network Service                       
  network-online.target              loaded active   active  Network is Online                     
  network-pre.target                 loaded inactive dead    Network (Pre)                         
  network.target                     loaded active   active  Network                               

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

7 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

在日志中可以看到,机器突然无法与另一台机器上的 influxdb 连接,之后我也无法 ssh。Journalctl 日志:

Aug 14 11:19:01 myhost pulseaudio[67379]: GetManagedObjects() failed: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
...
Aug 14 11:58:05 myhost telegraf[3018]: 2020-08-14T09:58:05Z E! [outputs.influxdb] When writing to [http://someip]: Post http://someip/write?consistency=any&db=telegraf: net/http: request canceled (Client.Timeout exceeded while awai>
Aug 14 11:58:05 myhost telegraf[3018]: 2020-08-14T09:58:05Z E! [agent] Error writing to outputs.influxdb: could not write any address

我在日志中看到的唯一其他相关内容是:

Aug 14 10:34:08 myhost systemd-timesyncd[2889]: Timed out waiting for reply from 91.189.91.157:123 (ntp.ubuntu.com).

但这是一个反复出现的事情,我不确定它是否与这个问题有关,或者只是网络的某些组件阻止了与该 IP 地址的连接。

相关内容