InnoDB:Error:io_setup () failed with Eagain after 5 attempts

Source: Internet
Author: User

Start multiple MySQL instances for the data file in a single server as a backup file for each database for use with SQL review.
There was no problem before running (up to 23 MySQL instances running at the same time), and then a new server was configured and failed to launch its corresponding instance.

Some error logs are as follows:
......
140505 16:05:59 innodb:using Linux native AIO
140505 16:05:59 InnoDB:Warning:io_setup () failed with Eagain. Would make 5 attempts before giving up.
InnoDB:Warning:io_setup () attempt 1 failed.
InnoDB:Warning:io_setup () attempt 2 failed.
InnoDB:Warning:io_setup () attempt 3 failed.
InnoDB:Warning:io_setup () attempt 4 failed.
InnoDB:Warning:io_setup () attempt 5 failed.
140505 16:06:02 InnoDB:Error:io_setup () failed with Eagain after 5 attempts.
Innodb:you can disable Linux Native AIO by setting Innodb_use_native_aio = 0 in my.cnf
140505 16:06:02 innodb:fatal error:cannot Initialize AIO sub-system
140505 16:06:02 [ERROR] Plugin ' InnoDB ' init function returned ERROR.
140505 16:06:02 [ERROR] Plugin ' InnoDB ' registration as a STORAGE ENGINE failed.
140505 16:06:02 [ERROR] unknown/unsupported storage Engine:innodb
......

Learn from the error log that the first error occurred in InnoDB:Error:io_setup () failed with Eagain after 5 attempts.
This io_setup () failed with Eagain is key.

We're a man, Io_setup.
NAME
Io_setup-create an asynchronous I/O context
......
DESCRIPTION
Io_setup () creates an asynchronous I/O context capable of receiving at least maxevents. Ctxp must not point to an AIO context that already exists, and must be
Initialized to 0
Prior to the call. On successful creation of the AIO context, *ctxp are filled in with the resulting handle.
RETURN VALUE
Io_setup () returns 0 on success; Otherwise, one of the errors listed in the ' Errors ' section is returned.
ERRORS
EINVAL Ctxp is not initialized, or the specified maxevents exceeds internal limits. Maxevents should be greater than 0.
Efault An invalid pointer are passed for CTXP.
ENOMEM Insufficient kernel resources is available.
Eagain the specified maxevents exceeds the user ' s limit of available events.
Enosys Io_setup () is not implemented on this architecture.
Conforming to
......
See that Io_setup is used to create an asynchronous I/O context for a specific purpose, and the error code Eagain means that the specified maxevents exceeds the user's available events limit.
A large number of MySQL instances have been run on the server, and the resources for creating asynchronous I/O have reached the critical threshold, so the new instance failed to start.

Finally, the problem is resolved by adding--innodb_use_native_aio = 0 When starting the MySQL instance.


There is also a fix to this issue by changing the system settings (to be verified).
CAT/PROC/SYS/FS/AIO-MAX-NR can see that the value of the current AIO-MAX-NR is generally 65536 (64k)

The following steps can be used to change the value in the file (the above file cannot be edited directly)
sudo vim/etc/sysctl.conf
Modify or Join
fs.aio-max-nr=262144 (256k)

Execute command Modify/PROC/SYS/FS/AIO-MAX-NR
Sysctl-p

You can see that the values in the/PROC/SYS/FS/AIO-MAX-NR have changed
Cat/proc/sys/fs/aio-max-nr

Restart MySQL Instance

And by modifying the MySQL source code to avoid the problem, but generally not recommended or necessary to do so.

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.