docker部署mysql無法啟動


環境

系統: centos7.7

docker: 19

mysql: 8.0.18

將原網址變更為

報錯分析

日志內容

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

問題分析

看到io_setup用來創建異步I/O上下文環境用於特定目的,錯誤代碼EAGAIN意為指定的maxevents 超出了用戶可用events的限制。
該服務器上已經運行了較多的MySQL實例,創建異步I/O的資源已經達到了臨界,所以新的實例啟動失敗。

解決方案一

啟動MySQL實例時加入 --innodb_use_native_aio = 0

解決方案二

cat /proc/sys/fs/aio-max-nr可以查看到當前的aio-max-nr的值一般為65536(64k個)

/etc/sysctl.conf

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

執行命令使其生效

sysctl -p

可以看到/proc/sys/fs/aio-max-nr中的值發生了變化
cat /proc/sys/fs/aio-max-nr

重啟MySQL實例

原文鏈接: https://www.cnblogs.com/nb-blog/p/8391601.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM