如何诊断linux随机崩溃

问题描述 投票:0回答:2

我有一个家庭服务器(运行标准桌面配置),我只使用 docker compose 堆栈。

有时它会随机崩溃(?)。当我的服务不可用并且我无法再通过 ssh 连接到它时,我会发现它。

我已经尝试过 2 个不同的操作系统,Ubuntu 服务器和 Nixos,所以我不怀疑它们是我的问题的根源。

发生这种情况时,我硬重新启动系统,之后一切正常。

这是我在系统日志中的日志(或更多缺少的日志),被截断为崩溃的那一刻。

sept. 11 01:52:25 nixos 9cd85f03e4e6[3105]:   },
sept. 11 01:52:25 nixos 9cd85f03e4e6[3105]:     'statsd.metrics_received': 0
sept. 11 01:52:25 nixos 9cd85f03e4e6[3105]:   },
sept. 11 01:52:25 nixos 9cd85f03e4e6[3105]:   sets: {},
sept. 11 01:52:25 nixos 9cd85f03e4e6[3105]:   pctThreshold: [ 90 ]
sept. 11 01:52:25 nixos 9cd85f03e4e6[3105]: }
sept. 11 02:00:25 nixos systemd[1]: Started Logrotate Service.
sept. 11 02:00:25 nixos systemd[1]: logrotate.service: Deactivated successfully.
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]: Flushing stats at  Mon Sep 11 2023 00:02:25 GMT+0000 (Coordinated Universal Time)
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]: {
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   counters: {
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:     'statsd.bad_lines_seen': 0,
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:     'statsd.packets_received': 0,
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:     'statsd.metrics_received': 0
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   },
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   timers: {},
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   gauges: { 'statsd.timestamp_lag': 0 },
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   timer_data: {},
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   counter_rates: {
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:     'statsd.bad_lines_seen': 0,
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:     'statsd.packets_received': 0,
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:     'statsd.metrics_received': 0
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   },
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   sets: {},
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]:   pctThreshold: [ 90 ]
sept. 11 02:02:25 nixos 9cd85f03e4e6[3105]: }
sept. 11 02:02:29 nixos d44e3444dc2e[3105]: 2023-09-11T00:02:29.668Z [MASTER] info: Purging orphaned upload files...
sept. 11 02:02:29 nixos d44e3444dc2e[3105]: 2023-09-11T00:02:29.669Z [MASTER] info: Purging orphaned upload files: [ COMPLETED ]
-- Boot ec700ac6b9a2458896b87f5c459872fe --
sept. 11 17:01:23 nixos kernel: Linux version 6.1.51 (nixbld@localhost) (gcc (GCC) 12.2.0, GNU ld (GNU Binutils) 2.40) #1-NixOS SMP PREEMPT_DYNAMIC Sat Sep  2 07:16:20 UTC 2023
sept. 11 17:01:23 nixos kernel: Command line: initrd=\efi\nixos\cix17i101cnd1v1q6k8n3zsl6dbf6a9b-initrd-linux-6.1.51-initrd.efi init=/nix/store/582kkbsscbzmvpirdfqc67mr5496y4ci-nixos-syst>
sept. 11 17:01:23 nixos kernel: BIOS-provided physical RAM map:

我不知道该怎么做才能继续调试这个。

linux docker crash
2个回答
0
投票

有可能某些容器占用了所有内存,并且您的系统内存不足。

你也可以检查一下docker日志吗?

我建议监控每个容器的内存使用情况。


0
投票

我认为我的问题可能是电脑的问题。我已经安装了 Proxmox 来拥有 2 个虚拟机,一个用于堆栈,另一个用于监视第一个虚拟机,mmy proxmox 崩溃了,我 99.9% 确定它不在 Linux 端。

© www.soinside.com 2019 - 2024. All rights reserved.