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

在一台server中以各数据库的备份文件为数据文件启动多个MySQL实例供SQL Review使用。

之前执行一直没有问题(最多的时候有23个MySQL实例同一时候执行)。后来新配置了一台server,启动其相应的实例时失败。

部分错误日志例如以下:

……

140505 16:05:59 InnoDB: Using Linux native AIO

140505 16:05:59  InnoDB: Warning: io_setup() failed with EAGAIN. Will 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

……

通过错误日志了解到最早错误发生的地方为 InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts。

这个io_setup() failed with EAGAIN是关键。

我们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 is 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 is passed for ctxp.

ENOMEM Insufficient kernel resources are available.

EAGAIN The specified maxevents exceeds the user’s limit of available events.

ENOSYS io_setup() is not implemented on this architecture.

CONFORMING TO

……

看到io_setup用来创建异步I/O上下文环境用于特定目的,错误代码EAGAIN意为指定的maxevents 超出了用户可用events的限制。

该server上已经执行了较多的MySQL实例,创建异步I/O的资源已经达到了临界,所以新的实例启动失败。

最后通过在启动MySQL实例时增加 --innodb_use_native_aio = 0攻克了问题。

也有通过更改系统设置来解决此问题的(待验证)。

cat /proc/sys/fs/aio-max-nr能够查看到当前的aio-max-nr的值一般为65536(64k个)

可通过下述步骤改变该文件里的值(上述文件不能直接编辑)

sudo vim /etc/sysctl.conf

改动或增加

fs.aio-max-nr=262144(256k个)

运行命令改动/proc/sys/fs/aio-max-nr

sysctl -p

能够看到/proc/sys/fs/aio-max-nr中的值发生了变化

cat /proc/sys/fs/aio-max-nr

重新启动MySQL实例

还有通过改动mysql源代码来避免该问题的,但普通情况下不推荐也没有必要这么做。

时间: 2024-08-06 07:53:49

InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts的相关文章

InnoDB: Error: io_setup() failed with EAGAIN

最近安装好了MySQL之后,在启动MySQL服务时无法正常启动MySQL.提示没有更新/var/lib/mfailedZDB.pid并退出.该MySQL与Oracle位于同一主机.有些内核参数进行过调整应该也是使用与MySQL.下面是该问题的具体描述. 1.故障现象SZDB:/usr/src/mysql_src # /etc/init.d/mysql startStarting MySQL...The server quit without updating PID file (/var/lib

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes

启动WAMP Server的时候报例如以下的错误: 140618 23:12:32 [Note] Plugin 'FEDERATED' is disabled. 140618 23:12:32 InnoDB: The InnoDB memory heap is disabled 140618 23:12:32 InnoDB: Mutexes and rw_locks use Windows interlocked functions 140618 23:12:32 InnoDB: Compres

【MySQL】InnoDB: Error: checksum mismatch in data file 报错

参考:http://www.jb51.net/article/66951.htm 用5.7版本启动原5.5实例后,再用5.5启动出现以下报错 InnoDB: Error: checksum mismatch in data file /data/mysql/ibdata1 160627 10:42:11 InnoDB: Could not open or create data files. 160627 10:42:11 InnoDB: If you tried to add new data

View Composer Agent initialization error (16): Failed to activate software license (1026556)

1.       桌面发布过程中偶尔有些桌面池中的桌面提示无法访问代理,查看报错信息如下:View Composer Agent initialization error (16):Failed to activate software license (1026556). KB地址:https://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1026556 主要意思是Windows 7系统激活的

转 InnoDB Error Handling

14.20.4 InnoDB Error Handling Error handling in InnoDB is not always the same as specified in the SQL standard. According to the standard, any error during an SQL statement should cause rollback of that statement. InnoDB sometimes rolls back only par

Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing(Android Studio编译错误)

今天下载了一个1.2.1.1版本的Android Studio,使用VPN更新好SDK之后就新建了一个hello world工程测试一下环境,然后就出现以下错误: Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing 什么情况?全新安装的环境也有错误?Google发布这个工具时没有测试好吗? 没搞过这个工具,一阵搜索得到以下方案: 1.右键工程->Open Module Settings 2.将Bu

InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

1,Mysqldump的时候报错如下: 2014-05-05 14:12:37 7f004a9a2700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found. 但是show tables我看这个表示存在的: 但是show create table innodb_index_stats;报错如下: mysql> show create table innodb_index_stats; ERRO

解决方案:Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing

也许有朋友最初在用Android Studio创建新工程的时候会碰到这个错误,其实这个问题是由于版本不兼容导致的,解决方法很简单,只需要把编译工具的版本改一下就可以了: 1.选左侧的工程根目录app,按F12打开Project Structure: 2.点击底部的app,把右侧Build Tool Version 从23.0.0 改为22.0.1即可~ 解决方案:Error:Execution failed for task ':app:compileDebugAidl'. > aidl is

Android中使用databinding编译时出现的error:Execution failed for task ':app:dataBindingProcessLayoutsDebug'

Windows环境下使用svn对AndroidStudio更新代码时,总会在源文件中出现一堆乱码,尤其是xml文件中的乱码,不仅找起来费劲,改起来更费劲. 最近从svn更新代码之后,编译时出现了下面这个提示,而且AS中没有错误提示,这可真是捉急了. databinding error:Execution failed for task ':app:dataBindingProcessLayoutsDebug' 后来,多亏这篇帖子提示,自己写了段代码来尝试下,http://stackoverflo