前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >InnoDB: Error: io_setup() failed with EAGAIN

InnoDB: Error: io_setup() failed with EAGAIN

作者头像
Leshami
发布2018-08-13 14:55:27
2.3K0
发布2018-08-13 14:55:27
举报
文章被收录于专栏:乐沙弥的世界乐沙弥的世界

    最近安装好了MySQL之后,在启动MySQL服务时无法正常启动MySQL。提示没有更新/var/lib/mfailedZDB.pid并退出。该MySQL与Oracle位于同一主机。有些内核参数进行过调整应该也是使用与MySQL。下面是该问题的具体描述。

1、故障现象 SZDB:/usr/src/mysql_src # /etc/init.d/mysql start Starting MySQL...The server quit without updating PID file (/var/lib/mfailedZDB.pid).

SZDB:~ # cat /etc/issue     #故障环境 Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64) - Kernel \r (\l).

2、故障分析 #查看err日志信息 SZDB:/var/lib/mysql # more SZDB.err 140505 16:05:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 140505 16:05:59 [Note] Plugin 'FEDERATED' is disabled. 140505 16:05:59 InnoDB: The InnoDB memory heap is disabled 140505 16:05:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140505 16:05:59 InnoDB: Compressed tables use zlib 1.2.3 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 140505 16:06:02 [ERROR] Aborting 140505 16:06:02 [Note] /usr/sbin/mysqld: Shutdown complete 140505 16:06:02 mysqld_safe mysqld from pid file /var/lib/mysql/SZDB.pid ended

#从上面的错误日志中可以看到,关键的一个信息io_setup() failed with EAGAIN #io_setup()锁定失败

3、故障解决 错误代码EAGAIN表明超出了可用event限制的最大值(见第4点中的描述) SZDB:~ # cat /proc/sys/fs/aio-max-nr 65536                        #64k个

SZDB:~ # vi /etc/sysctl.conf fs.aio-max-nr=262144         #调整为256k个

SZDB:~ # sysctl -p

#  Author : Leshami #  Blog   : http://blog.csdn.net/leshami

SZDB:~ # /etc/init.d/mysql start    #调整后启动成功 Starting MySQL...                                                     done

4、关于fs.aio-max-nr 该参数指同时可以拥有的的异步IO请求数目

aio-nr & aio-max-nr: aio-nr is the running total of the number of events specified on the io_setup system call for all currently active aio contexts.  If aio-nr reaches aio-max-nr then io_setup will fail with EAGAIN.  Note that raising aio-max-nr does not result in the pre-allocation or re-sizing of any kernel data structures.

NAME io_setup - Create an asynchronous I/O context

SYNOPSIS #include <libaio.h>

Tag           Description -----------   ------------------------------------ int io_setup (int maxevents, io_context_t *ctxp);

DESCRIPTION: io_setup() creates an asynchronous I/O context capable of receiving at least maxevents.#创建一个接收异步i/o的上下文环境 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: Tag     Description ------  ---------------------------------------------- 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.#此案例中返回的时超出了可用event限制的最大值

ENOSYS  io_setup() is not implemented on this architecture.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014年05月13日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 MySQL
腾讯云数据库 MySQL(TencentDB for MySQL)为用户提供安全可靠,性能卓越、易于维护的企业级云数据库服务。其具备6大企业级特性,包括企业级定制内核、企业级高可用、企业级高可靠、企业级安全、企业级扩展以及企业级智能运维。通过使用腾讯云数据库 MySQL,可实现分钟级别的数据库部署、弹性扩展以及全自动化的运维管理,不仅经济实惠,而且稳定可靠,易于运维。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档