我在安装新版 ubuntu 服务器时遇到了问题。我使用 systemd-networkd 配置了一个绑定网络,虽然可以正常工作,但每隔几个小时它就会停止工作。
10-bond0.netdev
[NetDev]
Name=bond0
Kind=bond
[Bond]
Mode=802.3ad
TransmitHashPolicy=layer3+4
10.bond0.网络
[Match]
Name=bond1
[Network]
DHCP=yes
IgnoreCarrierLoss=3s
DNSSEC=allow-downgrade
[DHCP]
CriticalConnection=true
UseMTU=true
UseDNS=true
20-enp2.网络
[Match]
Name=enp2s*
[Network]
Bond=bond0
PrimarySlave=true
当它关闭时,对 1.1.1.1 的 ping 操作会超时。
拨打电话systemctl restart systemd-networkd
即可解决问题,直到下次发生故障为止。
JournalCTL 没有太多信息:
Sep 24 23:19:58 ubuntu dockerd[2234]: time="2023-09-24T23:19:58.848298010-07:00" level=info msg="ignoring event" container=3fbe14e5fa152085825eda15884837103dc0309d2120ec174ff4e95032ba6b34 module=libcontainerd namespace=moby topic=/tasks>
Sep 24 23:19:58 ubuntu containerd[2064]: time="2023-09-24T23:19:58.849335383-07:00" level=info msg="shim disconnected" id=3fbe14e5fa152085825eda15884837103dc0309d2120ec174ff4e95032ba6b34
Sep 24 23:19:58 ubuntu containerd[2064]: time="2023-09-24T23:19:58.850399956-07:00" level=warning msg="cleaning up after shim disconnected" id=3fbe14e5fa152085825eda15884837103dc0309d2120ec174ff4e95032ba6b34 namespace=moby
Sep 24 23:19:58 ubuntu containerd[2064]: time="2023-09-24T23:19:58.850422459-07:00" level=info msg="cleaning up dead shim"
Sep 24 23:19:58 ubuntu containerd[2064]: time="2023-09-24T23:19:58.861310022-07:00" level=warning msg="cleanup warnings time=\"2023-09-24T23:19:58-07:00\" level=info msg=\"starting signal loop\" namespace=moby pid=84199 runtime=io.conta>
Sep 24 23:19:58 ubuntu kernel: br-c52bc0bd1c1d: port 8(vethcb79a19) entered disabled state
Sep 24 23:19:58 ubuntu kernel: veth9890882: renamed from eth0
Sep 24 23:19:58 ubuntu systemd-networkd[67041]: vethcb79a19: Lost carrier
Sep 24 23:19:59 ubuntu systemd-networkd[67041]: vethcb79a19: Link DOWN
Sep 24 23:19:59 ubuntu kernel: br-c52bc0bd1c1d: port 8(vethcb79a19) entered disabled state
Sep 24 23:19:59 ubuntu kernel: vethcb79a19 (unregistering): left allmulticast mode
Sep 24 23:19:59 ubuntu kernel: vethcb79a19 (unregistering): left promiscuous mode
Sep 24 23:19:59 ubuntu kernel: br-c52bc0bd1c1d: port 8(vethcb79a19) entered disabled state
Sep 24 23:19:59 ubuntu systemd[1]: run-docker-netns-de9f1c191dbc.mount: Deactivated successfully.
Sep 24 23:19:59 ubuntu systemd-networkd[67041]: vethd157647: Link UP
Sep 24 23:19:59 ubuntu kernel: br-c52bc0bd1c1d: port 8(vethd157647) entered blocking state
Sep 24 23:19:59 ubuntu kernel: br-c52bc0bd1c1d: port 8(vethd157647) entered disabled state
Sep 24 23:19:59 ubuntu kernel: vethd157647: entered allmulticast mode
Sep 24 23:19:59 ubuntu kernel: vethd157647: entered promiscuous mode
Sep 24 23:19:59 ubuntu kernel: br-c52bc0bd1c1d: port 8(vethd157647) entered blocking state
Sep 24 23:19:59 ubuntu kernel: br-c52bc0bd1c1d: port 8(vethd157647) entered forwarding state
Sep 24 23:19:59 ubuntu containerd[2064]: time="2023-09-24T23:19:59.340174610-07:00" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
Sep 24 23:19:59 ubuntu containerd[2064]: time="2023-09-24T23:19:59.340283346-07:00" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
Sep 24 23:19:59 ubuntu containerd[2064]: time="2023-09-24T23:19:59.340294305-07:00" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
Sep 24 23:19:59 ubuntu containerd[2064]: time="2023-09-24T23:19:59.340496916-07:00" level=info msg="starting signal loop" namespace=moby path=/run/containerd/io.containerd.runtime.v2.task/moby/6ccb401cf778dde29f8f774d7eb55e6e554f6bee56f>
Sep 24 23:19:59 ubuntu systemd[1]: Started docker-6ccb401cf778dde29f8f774d7eb55e6e554f6bee56fa56a2708b204552d59032.scope - libcontainer container 6ccb401cf778dde29f8f774d7eb55e6e554f6bee56fa56a2708b204552d59032.
Sep 24 23:19:59 ubuntu systemd[1]: var-lib-docker-zfs-graph-2a03199a967ef6e4679bf0a3f6c35375d871f651990efe369afc27dd8dc21333.mount: Deactivated successfully.
Sep 24 23:19:59 ubuntu kernel: eth0: renamed from veth9810974
Sep 24 23:19:59 ubuntu systemd-networkd[67041]: vethd157647: Gained carrier
Sep 24 23:20:00 ubuntu systemd-networkd[67041]: vethd157647: Gained IPv6LL
仅介绍一下丢失的承运人。
我正在使用 Unifi Dream Machine Pro 作为路由器,租赁时间设置为 7 天。
dmesg 显示:
[ 1061.210722] br-c52bc0bd1c1d: port 9(veth9f0f7b8) entered blocking state
[ 1061.210738] br-c52bc0bd1c1d: port 9(veth9f0f7b8) entered forwarding state
[ 1061.573317] eth0: renamed from veth8dd64c5
[ 1061.633580] eth0: renamed from veth9890882
[ 1061.657483] br-c52bc0bd1c1d: port 8(vethcb79a19) entered blocking state
[ 1061.657488] br-c52bc0bd1c1d: port 8(vethcb79a19) entered forwarding state
[ 4483.973435] perf: interrupt took too long (2545 > 2500), lowering kernel.perf_event_max_sample_rate to 78500
[ 4985.341221] perf: interrupt took too long (3182 > 3181), lowering kernel.perf_event_max_sample_rate to 62750
[ 9023.845905] perf: interrupt took too long (3999 > 3977), lowering kernel.perf_event_max_sample_rate to 50000
[19294.586812] bond0: (slave enp2s0f0): link status definitely down, disabling slave
[19294.586837] bond0: (slave enp2s0f1): link status definitely down, disabling slave
(我必须重新启动它才能通过 ssh 进入盒子来获取信息,因此它目前处于启动状态)ipAddr
enp2s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether 0e:5b:47:f7:88:46 brd ff:ff:ff:ff:ff:ff permaddr 80:61:5f:14:f7:73
3: enp2s0f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether 0e:5b:47:f7:88:46 brd ff:ff:ff:ff:ff:ff permaddr 80:61:5f:14:f7:74
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0e:5b:47:f7:88:46 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.18/24 brd 192.168.1.255 scope global bond0
valid_lft forever preferred_lft forever
inet6 fd10:9f58:b2f2:48fa:c5b:47ff:fef7:8846/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 1790sec preferred_lft 1790sec
inet6 fe80::c5b:47ff:fef7:8846/64 scope link
valid_lft forever preferred_lft forever
root@ubuntu:/etc/systemd/network# systemctl list-unit-files --state=enabled
UNIT FILE STATE PRESET
apparmor.service enabled enabled
console-setup.service enabled enabled
containerd.service enabled enabled
cron.service enabled enabled
dmesg.service enabled enabled
docker.service enabled enabled
e2scrub_reap.service enabled enabled
[email protected] enabled enabled
keyboard-setup.service enabled enabled
networkd-dispatcher.service enabled enabled
rsyslog.service enabled enabled
setvtrgb.service enabled enabled
ssh.service enabled enabled
systemd-network-generator.service enabled enabled
systemd-networkd-wait-online.service enabled disabled
systemd-networkd.service enabled enabled
systemd-pstore.service enabled enabled
systemd-resolved.service enabled enabled
systemd-timesyncd.service enabled enabled
ua-reboot-cmds.service enabled enabled
ubuntu-advantage.service enabled enabled
zfs-import-cache.service enabled enabled
zfs-load-module.service enabled enabled
zfs-mount.service enabled enabled
zfs-share.service enabled enabled
zfs-volume-wait.service enabled enabled
zfs-zed.service enabled enabled
docker.socket enabled enabled
ssh.socket enabled enabled
systemd-networkd.socket enabled enabled
remote-fs.target enabled enabled
zfs-import.target enabled enabled
zfs-volumes.target enabled enabled
zfs.target enabled enabled
apt-daily-upgrade.timer enabled enabled
apt-daily.timer enabled enabled
dpkg-db-backup.timer enabled enabled
e2scrub_all.timer enabled enabled
fstrim.timer enabled enabled
logrotate.timer enabled enabled
motd-news.timer enabled enabled
ua-timer.timer enabled enabled
我尝试了几乎所有能想到的方法,但这种情况还是不断发生。我不知道下一步该做什么或如何修复它。有人能帮忙吗?