Step One: Make sure supportutils has been installed
# rpm -q supportutils
supportutils-3.1.21-150300.7.35.15.1.noarch
(Add: If there is no output, it means supportutils need be installed)
Step Two: Input supportconfig command
# supportconfig
Step One: Make sure supportutils has been installed
# rpm -q supportutils
supportutils-3.1.21-150300.7.35.15.1.noarch
(Add: If there is no output, it means supportutils need be installed)
Step Two: Input supportconfig command
# supportconfig
# rpm -qa | grep crash || yum install crash ; rpm -qa | grep kernel-debug || yum install kernel-debug
# vim /etc/kdump.conf
修改以下内容:
......
path /var/crash
......
(
补充:
1) 默认的存放位置是 /var/crash
2) 把这里修改成想要存放内核崩溃信息的目录
3) 为了保险起见存放内核崩溃信息的位置最好有大于内存大小的剩余空间
)
# systemctl restart kdump ; systemctl enable kdump
# systemctl status kdump
(补充:当显示输出结果里包含 operational 或者 Active: active (exited) 时,则说明 Kdump 已经启用)
# vim /etc/sysctl.conf
添加以下内容:
......
kernel.hung_task_panic=1
# sysctl -p /etc/sysctl.conf
(步骤略)
(
注意:
1) 只有 task hang 住,或者处理器线程 soft lock 时才会自动产生 dump
2) 此过程系统会自动重启
)
# vim /etc/sysctl.conf
添加以下内容:
......
kernel.sysrq = 1
# sysctl -p /etc/sysctl.conf
同时先后按下以下三个按键:
ALT + PRINTSCREEN + C
(
注意:
1) 此过程会让系统自动重启
2) 只是系统死机并不代表有 kernel panic
)
# vim /etc/sysctl.conf
添加以下内容:
......
kernel.unknown_nmi_panic = 1
kernel.panic_on_unrecovered_nmi = 1
kernel.panic_on_io_nmi = 1
# sysctl -p /etc/sysctl.conf
(步骤略)
# echo c > /proc/sysrq-trigger
(注意:此操作会造成系统重启)
参考文献:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/system_design_guide/installing-and-configuring-kdump_system-design-guide
https://access.redhat.com/solutions/916043
https://access.redhat.com/solutions/3698411
https://access.redhat.com/solutions/6038
https://access.redhat.com/solutions/23069
# iptables -nvL
Chain INPUT (policy ACCEPT 5 packets, 500 bytes)
......
Chain FORWARD (policy DROP 0 packets, 0 bytes)
......
Chain OUTPUT (policy DROP 1000 packets, 200K bytes)
......
(
补充:
1) 这里的 policy ACCEPT 5 packets, 500 bytes 是指接收了 5 个数据包和 500 bytes 流量,ACCEPT 是指接收的状态
2) 这里的 policy DROP 1000 packets, 200K bytes 是指发出了 1000 数据包和 200K bytes 流量。DROP 是拒绝的状态
)
默认情况下,journal 的日志存储在 /run/log/journal,而 /run 目录只是一个临时目录。
将 Storage 参数设置为 persistent 后,journal 的日志将存储在 /var/log/journal,/var/log 则是一个永久的目录。
# vi /etc/systemd/journald.conf
将部分内容修改如下:
[Journal]
......
Storage=persistent
......
# systemctl restart systemd-journald.service
https://linuxconfig.org/introduction-to-the-systemd-journal
当一个用户没有某些挂载目录的读权限时,使用 df -h 命令会不显示这些目录。但是如果给 df 命令加上 –all 选项,则又可以看到这些目录。例如:
$ df --all
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/mapper/share2 - - - - /test/02
/dev/mapper/share1 - - - - /test/01