我的主要 SolusVM 节点/OpenVZ 节点今天突然需要重新启动并升级内核。因此,我们在几个 VPS 单元上完成了此操作,但由于某种原因,MySQL 在重新启动后无法启动。这只是部分 VPS 单元,而不是全部。
中的错误/var/log/mysql/error.log
如下:
140415 11:12:29 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
140415 11:12:29 InnoDB: Fatal error: cannot initialize AIO sub-system
140415 11:12:29 [ERROR] Plugin 'InnoDB' init function returned error.
140415 11:12:29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140415 11:12:29 [ERROR] Unknown/unsupported storage engine: InnoDB
140415 11:12:29 [ERROR] Aborting
140415 11:12:29 [Note] /usr/sbin/mysqld: Shutdown complete
140415 11:12:30 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140415 11:12:30 [Note] Plugin 'FEDERATED' is disabled.
140415 11:12:30 InnoDB: The InnoDB memory heap is disabled
140415 11:12:30 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140415 11:12:30 InnoDB: Compressed tables use zlib 1.2.7
140415 11:12:30 InnoDB: Using Linux native AIO
140415 11:12:30 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_use_native_aio = 0
在 my.cnf 中进行设置,但也没有解决问题。我还尝试进行以下设置:
default-storage-engine=myisam
skip_innodb
还是不行。我也试过这个,但不行:
sudo touch /etc/apparmor.d/local/usr.sbin.mysqld
service mysqld start
答案1
必须运行重新配置才能使其再次工作。这需要一些时间才能让程序自行完成,它还出错并说无法设置 mysql root 密码。
但最后它重新启动了 mysql 并且一切恢复正常。
dpkg-reconfigure mysql-server-5.5