CN109062627A - A kind of configuration method of Linux server system kdump service - Google Patents

A kind of configuration method of Linux server system kdump service Download PDF

Info

Publication number
CN109062627A
CN109062627A CN201810763977.7A CN201810763977A CN109062627A CN 109062627 A CN109062627 A CN 109062627A CN 201810763977 A CN201810763977 A CN 201810763977A CN 109062627 A CN109062627 A CN 109062627A
Authority
CN
China
Prior art keywords
kdump
configuration
server
memory
kernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810763977.7A
Other languages
Chinese (zh)
Inventor
张旭芳
匡志鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810763977.7A priority Critical patent/CN109062627A/en
Publication of CN109062627A publication Critical patent/CN109062627A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention provides a kind of configuration method of Linux server system kdump service, and creation configuration script carries out automatic configuration, includes the following steps: the region of memory for configuring kdump kernel;Configure kdump config file;Kernel parameter is configured, and will be set as coming into force in real time with the kdump postponed.Whether detection service device system installs kexec-tools kit, if having installed, executes configuration process, otherwise exits configuration process.Configuration file is backed up;The size of the total memory of detection service device, and the size for collapsing memory is calculated according to the size of the total memory of server;The setting of collapse memory address space is carried out according to the size of calculated collapse memory.

Description

A kind of configuration method of Linux server system kdump service
Technical field
The present invention relates to server system technical fields, and in particular to a kind of Linux server system kdump service is matched Set method.
Background technique
The analyzing and positioning of server system failure, the collection of log are bases.When delay machine, crash etc. occur for server system When catastrophe failure, if vmcore log can be generated, fast and accurately positioning failure can be helped by analyzing vmcore.
It, can if being configured with kdump service when the serious problems such as delay machine, blank screen, crash occur for server system Enough automatic or manual triggering linux systems generate Kernel Panic dump file vmcore, facilitate to the parsing of vmcore such The positioning of serious problems.
Kdump be system crash, deadlock or crash when for dump memory operating parameter a tool and Service, if system once work of having no idea once the so normal kernel of collapse, will generate one by kdump during this time A kernel for capture current operational information, the kernel can by all operating status sum numbers in memory at this time it is believed that Breath is collected into a dump core file in order to which Red Hat engineer analyzes crash reason, once memory information has been collected At system will be restarted automatically.
But the configuration of kdump service is more complicated cumbersome, needs user according to configuration documentation, operation step by step needs Multiple configuration files are modified, multiple orders, time-consuming and easy error are needed to be implemented, once error, it is also unusual to search reason It is time-consuming.
Summary of the invention
In order to overcome the deficiencies in the prior art described above, the present invention provides a kind of Linux server system kdump service Configuration method, to solve the above technical problems.
In order to achieve the above object, the technical scheme is that
A kind of configuration method of Linux server system kdump service, creation configuration script carry out automatic configuration, including such as Lower step:
Configure the region of memory of kdump kernel;
Configure kdump config file;
Kernel parameter is configured, and will be set as coming into force in real time with the kdump postponed.
Further, include: before the region of memory of step configuration kdump kernel
Whether detection service device system installs kexec-tools kit, if having installed, executes configuration process, otherwise exits and match Set process.
Further, the region of memory of step configuration kdump kernel includes:
Configuration file is backed up;
The size of the total memory of detection service device, and the size for collapsing memory is calculated according to the size of the total memory of server;
The setting of collapse memory address space is carried out according to the size of calculated collapse memory.
Further, the size of the total memory of step detection service device, and calculated and collapsed according to the size of the total memory of server The size of memory, comprising:
If the total memory of server is less than 2G, memory crashkernel=128M is collapsed, otherwise, collapse memory crashkernel= auto。
Further, step configuration kdump config file specifically includes:
Original configuration file is backed up;
Configure the dump position of vmcore;
Configure the Compression Strategies of vmcore;
After configuring kdump generation, server is restarted;
The automatic starting of kdump service booting is configured, and restarts kdump service.
Further, the Compression Strategies of step configuration vmcore, comprising:
Remove all extra pages in vmcore, and vmcore is compressed.
Further, step configures kernel parameter, comprising:
Standby system kernel parameter file
Kernel parameter when configuration triggering key trigger the server is hung up;
The kernel parameter that kdump is triggered when soft-lock occurs for configuration system;
The kernel parameter that kdump is triggered when memory overflows occurs for configuration system.
Further, kdump configuration file the file default of system crash just is placed on/var/crash in, crash File is transmitted to remote server after being placed on local server or collapse.
Further, crash file is transmitted to remote server after being placed on local server or collapse, comprising:
Local server and remote server communicate to connect;
Remote server sends order for the Serial Port Information remoting redirection of local server to remote server serial ports;
The kernel that remote server sends interrupts to local server triggering local server system crash generation positioning failure collapses Routed log, local server Serial Port Information are shown by network transmission to remote server, and in remote server.
As can be seen from the above technical solutions, the invention has the following advantages that running the script by an order All kdump configuration operations are automatically performed, O&M efficiency is improved, avoiding user, issuable match is ordered in execution by hand Mistake is set, and the script file can be copied to USB flash disk or be put on network server, user's carry USB flash disk or network scp life It enables a key on any server dispose kdump, substantially increases the O&M efficiency of bulk service device.
In addition, design principle of the present invention is reliable, structure is simple, has very extensive application prospect.
It can be seen that compared with prior art, the present invention have substantive distinguishing features outstanding and it is significant ground it is progressive, implementation Beneficial effect be also obvious.
Detailed description of the invention
Fig. 1 is a kind of configuration method flow diagram of Linux server system kdump service;
Fig. 2 is the region of memory flow diagram for configuring kdump kernel.
Specific embodiment
The present invention will be described in detail with reference to the accompanying drawing and by specific embodiment, and following embodiment is to the present invention Explanation, and the invention is not limited to following implementation.
Embodiment one
A kind of configuration method of Linux server system kdump service, designs kdump auto-configuration script, by the script file It copies USB flash disk to or is put on network server, user's carry USB flash disk or network scp order a key on any server are disposed kdump;It specifically includes:
Script file KdumpConfig.sh is created, specific content for script is as follows, runs script file sh KdumpConfig.sh can be automatically performed all Kdump configurations:
#!/bin/sh
# checks whether kexec-tools packet has been installed, if having installed, continues following configuration;If it is not installed, prompt user It installs and exits script
if ! rpm -q kexec-tools > /dev/null
then
echo "kexec-tools no found, please run command yum install kexec-tools to install it"
exit 1
fi
# configures crash kernel, and the configuration file for needing to modify is grub_conf, in the server system of BIOS guidance Grub_conf=/boot/grub2/grub.cfg, if in the system of UEFI guidance,
grub_conf=/boot/efi/EFI/redhat/grub.cfg
grub_conf=/boot/grub2/grub.cfg
# carries out back-up to configuration file first
cp $grub_conf $grub_conf.bak.$(date +%y-%m-%d-%H:%M:%S)
# checks the total memory size of server
mem_total=`free -g |awk 'NR==2 {print $2 }'`
# calculates crashkernel size, if the total memory of server is less than 2G, crashkernel=128M, otherwise, crashkernel=auto
compute_rhel7_crash_kernel ()
{
mem_size=$1
if [ $mem_size -le 2 ]
then
reserved_memory="128M"
else
reserved_memory="auto"
fi
echo "$reserved_memory"
}
crashkernel_para=`compute_rhel7_crash_kernel $mem_total `
# configures crashkernel, the row that linux starts in grub File is found, first by the parameter of crashkernel=* Remove, be configured further according to the size of crashkernel computed above:
crashkernel=$crashkernel_para
sed -i '/^\tlinux/
s/crashkernel=\(auto\|[[:digit:]]*[mM]@[[:digit:]]*[mM]\|[[:digit:]]* [mM]\)//g' $grub_conf
sed -i ' /^\tlinux/ s/$/ crashkernel='$crashkernel_para'/g' $grub_conf
#kdump config file configuration
# first backs up original configuration file
kdump_conf=/etc/kdump.conf
cp $kdump_conf $kdump_conf.bak.$(date +%y-%m-%d-%H:%M:%S)
Dump position/var/crash of # configuration vmcore
echo path /var/crash > $kdump_conf
The Compression Strategies of # configuration vmcore: remove all extra pages, and compress
echo core_collector makedumpfile -c --message-level 1 -d 31 >> $kdump_ conf
After # configures kdump generation, the subsequent default behavior of system: server is restarted
echo 'default reboot' >> $kdump_conf
# configures the automatic starting of kdump service booting, and restarts kdump service
systemctl enable kdump.service
systemctl restart kdump.service
# configures kernel parameter
# standby system kernel parameter file first
sysctl_conf=/etc/sysctl.conf
cp $sysctl_conf $sysctl_conf.bak.$(date +%y-%m-%d-%H:%M:%S)
Kernel parameter when magic key alt+sysrq+c or NMI triggering server hang is pressed in # configuration
sed -i '/^kernel.sysrq/ s/kernel/#kernel/g ' $sysctl_conf
echo 'kernel.sysrq=1' >> $sysctl_conf
echo 'kernel.unknown_nmi_panic=1' >> $sysctl_conf
echo 'kernel.panic_on_unrecovered_nmi=1' >> $sysctl_conf
echo ' kernel.panic_on_io_nmi =1' >> $sysctl_conf
# configures system and the kernel parameter for triggering kdump when soft-lock occurs
sed -i '/^kernel.softlockup_panic/ s/kernel/#kernel/g ' $sysctl_conf
echo 'kernel.softlockup_panic=1' >> $sysctl_conf
# configures system and the kernel parameter for triggering kdump when memory overflows occurs
sed -i '/^kernel.panic_on_oom/ s/kernel/#kernel/g ' $sysctl_conf
echo 'vm.panic_on_oom=1' >> $sysctl_conf
Embodiment two
As Figure 1-Figure 2, a kind of configuration method of Linux server system kdump service, is used for Remote triggering server system System generates Kernel Panic log transmission to remote server, includes the following steps:
S1: the kdump service of configuration server, including:
S21: whether detection service device system installs kexec-tools kit, if having installed, executes configuration process, otherwise moves back Configuration process out;
S22: the region of memory of configuration kdump kernel, including:
Configuration file is backed up;
The size of the total memory of detection service device, and the size for collapsing memory is calculated according to the size of the total memory of server, if service The total memory of device is less than 2G, collapses memory crashkernel=128M, otherwise, collapses memory crashkernel=auto;
The setting of collapse memory address space is carried out according to the size of calculated collapse memory;
S23: configuration kdump config file, including:
Original configuration file is backed up;
Configure the dump position of vmcore;
Configure the Compression Strategies of vmcore;
After configuring kdump generation, server is restarted;
The automatic starting of kdump service booting is configured, and restarts kdump service.
S24: configuration kernel parameter, and will be set as coming into force in real time with the kdump postponed;
Standby system kernel parameter file
Kernel parameter when configuration triggering key trigger the server is hung up;
The kernel parameter that kdump is triggered when soft-lock occurs for configuration system;
The kernel parameter that kdump is triggered when memory overflows occurs for configuration system.
The file default of system crash just is placed on by S25:kdump configuration file/var/crash in, crash file is put It sets and is transmitted to remote server after local or collapse, including:
S:251: opening sysrq, and editor/etc/sysctl.conf file increases kernel.sysrq=1, makes server sysrq It comes into force;
S252: the serial ports parameter of configuration server, in grub configuration file, increase console=ttyS0,115200 Console=tty0 parameter enables serial ports.
Under the premise of guaranteeing local server and far-end network intercommunication (connecting the same interchanger), in remote server It is upper by ipmitool order by the Serial Port Information remoting redirection of local server to remote server serial ports, local server End Serial Port Information is shown in remote server:
#ipmitool-I lanplus-H server ip-U server B MC user name-P server B MC password sol activate
Interrupt instruction is sent to local server by remote server;Interrupt instruction is sent by (Shift+ ~+B) Macintosh To server, after sending successfully, there is [send break] in interface;
C key is pressed, the i.e. transmittable sysrq event of serial ports to server, trigger the server crash generate vmcore, pass through string Port transmission is shown to remote server.
Description and claims of this specification and term " first ", " second ", " third " " in above-mentioned attached drawing The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage The data that solution uses in this way are interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to Here the sequence other than those of diagram or description is implemented.In addition, term " includes " and " having " and their any deformation, It is intended to cover and non-exclusive includes.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (9)

1. a kind of configuration method of Linux server system kdump service, creation configuration script carries out automatic configuration, special Sign is, includes the following steps:
Configure the region of memory of kdump kernel;
Configure kdump config file;
Kernel parameter is configured, and will be set as coming into force in real time with the kdump postponed.
2. a kind of configuration method of Linux server system kdump service according to claim 1, which is characterized in that step Include: before the region of memory of rapid configuration kdump kernel
Whether detection service device system installs kexec-tools kit, if having installed, executes configuration process, otherwise exits and match Set process.
3. a kind of configuration method of Linux server system kdump service according to claim 2, which is characterized in that step Suddenly the region of memory of configuration kdump kernel includes:
Configuration file is backed up;
The size of the total memory of detection service device, and the size for collapsing memory is calculated according to the size of the total memory of server;
The setting of collapse memory address space is carried out according to the size of calculated collapse memory.
4. a kind of configuration method of Linux server system kdump service according to claim 3, which is characterized in that step The size of the total memory of rapid detection service device, and the size for collapsing memory is calculated according to the size of the total memory of server, comprising:
If the total memory of server is less than 2G, memory crashkernel=128M is collapsed, otherwise, collapse memory crashkernel= auto。
5. a kind of configuration method of Linux server system kdump service according to claim 4, which is characterized in that step Rapid configuration kdump config file specifically includes:
Original configuration file is backed up;
Configure the dump position of vmcore;
Configure the Compression Strategies of vmcore;
After configuring kdump generation, server is restarted;
The automatic starting of kdump service booting is configured, and restarts kdump service.
6. a kind of configuration method of Linux server system kdump service according to claim 5, which is characterized in that step The Compression Strategies of rapid configuration vmcore, comprising:
Remove all extra pages in vmcore, and vmcore is compressed.
7. a kind of configuration method of Linux server system kdump service according to claim 6, which is characterized in that step Rapid configuration kernel parameter, comprising:
Standby system kernel parameter file
Kernel parameter when configuration triggering key trigger the server is hung up;
The kernel parameter that kdump is triggered when soft-lock occurs for configuration system;
The kernel parameter that kdump is triggered when memory overflows occurs for configuration system.
8. a kind of configuration method of Linux server system kdump service according to claim 7, which is characterized in that
The file default of system crash just is placed on by kdump configuration file/var/crash in, crash file is placed on local Remote server is transmitted to after server or collapse.
9. a kind of configuration method of Linux server system kdump service according to claim 8, which is characterized in that Crash file is transmitted to remote server after being placed on local server or collapse, comprising:
Local server and remote server communicate to connect;
Remote server sends order for the Serial Port Information remoting redirection of local server to remote server serial ports;
The kernel that remote server sends interrupts to local server triggering local server system crash generation positioning failure collapses Routed log, local server Serial Port Information are shown by network transmission to remote server, and in remote server.
CN201810763977.7A 2018-07-12 2018-07-12 A kind of configuration method of Linux server system kdump service Pending CN109062627A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810763977.7A CN109062627A (en) 2018-07-12 2018-07-12 A kind of configuration method of Linux server system kdump service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810763977.7A CN109062627A (en) 2018-07-12 2018-07-12 A kind of configuration method of Linux server system kdump service

Publications (1)

Publication Number Publication Date
CN109062627A true CN109062627A (en) 2018-12-21

Family

ID=64816265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810763977.7A Pending CN109062627A (en) 2018-07-12 2018-07-12 A kind of configuration method of Linux server system kdump service

Country Status (1)

Country Link
CN (1) CN109062627A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347571A (en) * 2019-07-09 2019-10-18 深圳市网心科技有限公司 A kind of crash log acquisition method, analysis method and relevant apparatus
CN113434150A (en) * 2021-08-30 2021-09-24 麒麟软件有限公司 Linux kernel crash information positioning method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1901569A (en) * 2006-07-05 2007-01-24 华为技术有限公司 Remote regulating method and system
CN104254840A (en) * 2012-04-27 2014-12-31 马维尔国际贸易有限公司 Memory dump and analysis in a computer system
CN105242981A (en) * 2015-10-30 2016-01-13 浪潮电子信息产业股份有限公司 Configuration method of Kdump and computer device
CN106293984A (en) * 2016-08-11 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of computer glitch automatically processes mode and device
CN106776090A (en) * 2016-11-29 2017-05-31 郑州云海信息技术有限公司 A kind of method for collecting information when RHEL operating systems are without response
CN107832166A (en) * 2017-11-27 2018-03-23 郑州云海信息技术有限公司 A kind of Linux server is delayed machine trouble analysis system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1901569A (en) * 2006-07-05 2007-01-24 华为技术有限公司 Remote regulating method and system
CN104254840A (en) * 2012-04-27 2014-12-31 马维尔国际贸易有限公司 Memory dump and analysis in a computer system
CN105242981A (en) * 2015-10-30 2016-01-13 浪潮电子信息产业股份有限公司 Configuration method of Kdump and computer device
CN106293984A (en) * 2016-08-11 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of computer glitch automatically processes mode and device
CN106776090A (en) * 2016-11-29 2017-05-31 郑州云海信息技术有限公司 A kind of method for collecting information when RHEL operating systems are without response
CN107832166A (en) * 2017-11-27 2018-03-23 郑州云海信息技术有限公司 A kind of Linux server is delayed machine trouble analysis system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
程和侠 等: "《Linux操作系统》", 31 January 2017, 中国科学技术大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347571A (en) * 2019-07-09 2019-10-18 深圳市网心科技有限公司 A kind of crash log acquisition method, analysis method and relevant apparatus
CN113434150A (en) * 2021-08-30 2021-09-24 麒麟软件有限公司 Linux kernel crash information positioning method

Similar Documents

Publication Publication Date Title
CN102929747B (en) Method for treating crash dump of Linux operation system based on loongson server
CN103377063B (en) From legacy operating systems environment recovery to the method and system of UEFI pre-boot environment
KR100773004B1 (en) System and apparatus for eliminating user interaction during hardware configuration at system boot
US8307363B2 (en) Virtual machine system, restarting method of virtual machine and system
US8260841B1 (en) Executing an out-of-band agent in an in-band process of a host system
CN102439565B (en) Method and device for starting recovery
TW200416544A (en) Recovery method of multi-functional operating system and system thereof
CN102880527B (en) Data recovery method of baseboard management controller
CN105607972B (en) A kind of method and device repaired extremely
CN109002346B (en) Conversion method of Windows virtual machine bootstrap program
JP2009140194A (en) Method for setting failure recovery environment
WO2014026547A1 (en) Active usb device and switching method for operating mode thereof
CN109062627A (en) A kind of configuration method of Linux server system kdump service
CN105183521A (en) Method for installing computing operation system and USB port storage device
CN102073524B (en) A kind of method of wireless communication terminal and self-starting thereof
CN108762886B (en) Fault detection recovery method and system for virtual machine
CN109976886B (en) Kernel remote switching method and device
CN105242981A (en) Configuration method of Kdump and computer device
CN110162389B (en) Application program starting method and device and intelligent interaction equipment
WO2013097095A1 (en) Method for backing up startup information about storage device
EP2562649B1 (en) Method for repairing communication abnormality between data card and host
JP4141409B2 (en) External peripherals
CN113568714A (en) Disk management method, device, electronic equipment and storage medium
TWI554876B (en) Method for processing node replacement and server system using the same
CN112817642A (en) Method and device for starting EFI operating system by X86 platform through automatic firmware switching

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181221