"Original" to get MySQL crash when the core file

Source: Internet
Author: User

Recently there is a server MySQL often crash, in order to further locate the problem, the MySQL core file function is opened, the following steps for reference

"Open Step"

1. Add 2 configuration options in the My.cnf file

[Mysqld]

Core_file

[Mysqld_safe]

core-file-size=unlimited

2, modify the system parameters, configuration Suid_dumpable

Echo 1 >/proc/sys/fs/suid_dumpable

3, restart the MySQL service, the configuration takes effect

Service MySQL Restart

"Generate Core file"

1, simulation of MySQL crash scene, KILL–SEGV

2. After MySQL crash, the time to generate the core file depends on the amount of memory that MySQL occupies

The test environment generates a 21G core file, which takes about 3 minutes, during which the MySQL process exists, but the MySQL service cannot respond. In this case, the MHA switch occurs.

3, during the generation of core file, can not manually kill the MySQL process, otherwise the resulting core file will be truncated, unable to parse properly, after core dump, MySQL will automatically restart

4. After the core file is generated, you can use GDB to analyze

"Issues to be aware of"

1. You need to reserve enough disk space for the directory where the core file is generated, the default path will be generated in the data directory, file size reference mysql occupied memory size

2. Generating core file will prolong the time of automatic recovery of MySQL crash

"Original" to get MySQL crash when the core file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.