0

在我的 my.cnf 中,我目前有以下内容

innodb-write-io-threads        = 32
innodb-read-io-threads         = 32

当我尝试将其增加到 48 时,本机 AIO 无法启动。

2016-08-22T05:02:35.933600Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.13-6-log) starting as process 23187 ...
2016-08-22T05:02:35.941699Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-08-22T05:02:35.941736Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-22T05:02:35.941748Z 0 [Note] InnoDB: Uses event mutexes
2016-08-22T05:02:35.941755Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-08-22T05:02:35.941762Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2016-08-22T05:02:35.941769Z 0 [Note] InnoDB: Using Linux native AIO
2016-08-22T05:02:35.942435Z 0 [Note] InnoDB: Number of pools: 1
2016-08-22T05:02:35.942597Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-08-22T05:02:35.951309Z 0 [Warning] InnoDB: io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
2016-08-22T05:02:35.951329Z 0 [Warning] InnoDB: io_setup() attempt 1.
2016-08-22T05:02:36.451533Z 0 [Warning] InnoDB: io_setup() attempt 2.
2016-08-22T05:02:36.951724Z 0 [Warning] InnoDB: io_setup() attempt 3.
2016-08-22T05:02:37.451960Z 0 [Warning] InnoDB: io_setup() attempt 4.
2016-08-22T05:02:37.952196Z 0 [Warning] InnoDB: io_setup() attempt 5.
2016-08-22T05:02:38.452394Z 0 [ERROR] InnoDB: io_setup() failed with EAGAIN after 5 attempts.
2016-08-22T05:02:38.452437Z 0 [Note] InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
2016-08-22T05:02:38.452776Z 0 [ERROR] InnoDB: Cannot initialize AIO sub-system
2016-08-22T05:02:38.452789Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2016-08-22T05:02:38.452799Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-08-22T05:02:38.452805Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-08-22T05:02:38.452812Z 0 [ERROR] Failed to initialize plugins.
2016-08-22T05:02:38.452817Z 0 [ERROR] Aborting
2016-08-22T05:02:38.452844Z 0 [Note] Binlog end
2016-08-22T05:02:38.452891Z 0 [Note] Shutting down plugin 'CSV'
2016-08-22T05:02:38.452899Z 0 [Note] Shutting down plugin 'MyISAM'
2016-08-22T05:02:38.454072Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

这是我完整的 my.cnf:

[mysql]

# CLIENT #
port                           = 3306
socket                         = /var/lib/mysql/mysql.sock

[mysqld]

# GENERAL #
user                           = mysql
default-storage-engine         = InnoDB
socket                         = /var/lib/mysql/mysql.sock
pid-file                       = /var/lib/mysql/mysql.pid
bind-address                    = 0.0.0.0
event_scheduler                 = on

# MyISAM #
key-buffer-size                = 32M
#myisam-recover                 = FORCE,BACKUP

# SAFETY #
max-allowed-packet             = 16M
max-connect-errors             = 1000000
skip-name-resolve
sql-mode                       = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
sysdate-is-now                 = 1
innodb                         = FORCE

# DATA STORAGE #
datadir                        = /var/lib/mysql/

# BINARY LOGGING #
log-bin                        = /var/lib/mysql/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 0
server-id                      = 1

# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 500
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 1024
table-open-cache               = 2048

# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 512M
innodb-flush-log-at-trx-commit = 2
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 160G
innodb-doublewrite             = 0
innodb-adaptive-flushing       = 1
innodb-thread-concurrency      = 0
innodb-write-io-threads        = 32
innodb-read-io-threads         = 32
innodb-buffer-pool-instances   = 64
innodb-flush-neighbors         = 0

# LOGGING #
log-error                      = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes  = 1
slow-query-log                 = 1
slow-query-log-file            = /var/lib/mysql/mysql-slow.log

这可能是什么原因造成的?

谢谢

4

0 回答 0