1.使用192.168.52.99搭建nfs服务器(系统已安装nfs-utils:yum install nfs-utils):
编辑# vim /etc/exports文件,添加 /mnt *(rw,sync,no_root_squash),然后重启nfs服务:#systemctl restart nfs;
关闭防火墙:
#systemctl stop firewalld
#setenforce 0
步骤2-6在测试机上执行
2.编辑# vim /etc/kdump.conf,添加:
nfs 192.168.52.99:/mnt
core_collector makedumpfile -l --message-level 1 -d 31
3.创建并挂载nfs目录
# yum install -y nfs-utils 安装nfs
# mkdir /nfs
# mount -t nfs -o rw 192.168.52.99:/mnt /nfs
# mkdir -p /nfs/var/crash
4.添加开机自动挂载nfs目录
编辑# vim /etc/fstab文件,添加:
192.168.52.99:/mnt /nfs nfs defaults 0 0
5.关闭防火墙:
#systemctl stop firewalld
#setenforce 0
6.重启kdump服务
# systemctl restart kdump
7.模拟崩溃,执行#echo c> /proc/sysrq-trigger;
8.待机器重启后,在NFS服务器中查看vmcore:
# cd /mnt/var/crash/%DATE/
# file vmcore
# strings vmcore | head -n 20