我曾经听到这么一个故事: 一个年轻的程序员问一个老程序员(一个比较牛逼的公司的CTO) 年轻程序员: 你为什么这么牛X., 就好像没有你不会的。老程序员: 积累的。年轻程序员: 怎么才能积累到您的程度呢。我每天都在积累。但是似乎都没有感觉到进步。老程序员: 我从20岁开始做到了一件事情,直到今天,而且尽可能地保证不间断。年轻程序员: 到底是什么? 老程序员: 我每天保证自己有2个小时在学习新的东西。

Kdump configuration

上一篇 / 下一篇  2011-12-21 11:19:52 / 个人分类:linux

 How to get Kdump file when host crash

1.# yum install kexec-tools -y

 2. Configure kdump.conf,give the path of the dump file.

 #vim /etc/kdump.conf

      .....

      path /var/crash
    core_collector makedumpfile -d 17 -c

 3. Add "crashkernel=128M@16M" or "crashkernel=auto"  to kernel parameters.#vim /boot/grub/grub.conf

 4. Reboot host. After reboot,run #free -m. You will see the memory will decrease 128M if set "crashkernel=128M@16M".

      # free -m
                      total       used       free     shared    buffers     cached
    Mem:          7917        962       6955          0         67        497
    -/+ buffers/cache:        396       7520
    Swap:            0          0          0
  ~*** Before add "crashkernel=128M@16M",the total memory is 8046 ***

5. Restart kdump service.  (If you had a kdump initrd file in /boot/,please remove it before restart kdump service.)

    # service kdump restart
    Stopping kdump:                                            [  OK  ]
    No kdump initial ramdisk found.                            [WARNING]
    Rebuilding /boot/initrd-2.6.32-220.el6.x86_64kdump.img
    Starting kdump:                                            [  OK  ]
  # chkconfig kdump on  

 6. Crash the Host,the kdump file will be in /var/crash path. You can use # echo "c" > /proc/sysrq-trigger  to test it.


**如果用init 5,host crash后,直接重启,没有产生dump 文件,则可能与kexec/图形界面有关,到init 3 试试**

TAG:

 

评分:0

我来说两句

Open Toolbar