Centos

Cent OS - MySQL 守護程序無法啟動

  • January 16, 2014

我正在執行具有 0.615 GB 記憶體的 AWS 微型實例。

我在其上執行 APC,預設最大為 35 MB。

現在我重新啟動了mysqld,它不會啟動。它剛剛停止。我現在真的需要啟動並執行它。它對我來說非常緊迫。

以下是日誌,請分享您的經驗,以最快的速度解決此問題。

提前致謝,

140111 14:49:32 [Warning] IP address '113.10.247.183' could not be resolved: Name or service not known
140111 14:59:42 [Warning] IP address '59.53.68.15' could not be resolved: Name or service not known
140111 21:01:00 [Warning] IP address '216.99.158.94' could not be resolved: Name or service not known
140112  1:05:51 [Warning] IP address '117.41.249.134' could not be resolved: Name or service not known
140112  2:06:52 [Warning] IP address '218.205.137.122' could not be resolved: Name or service not known
140113  1:29:44 [Warning] IP address '50.23.54.2' has been resolved to the host name '50.23.54.2-static.reverse.softlayer.com', which resembles IPv4-address itself.
140113 12:49:09 [Warning] IP address '113.10.137.11' could not be resolved: Name or service not known
140114  0:36:22 [Warning] IP address '198.13.101.242' could not be resolved: Temporary failure in name resolution
140114  1:03:19 [Warning] IP address '182.18.30.92' could not be resolved: Temporary failure in name resolution
140114 18:42:41 [Warning] IP address '183.136.213.198' could not be resolved: Name or service not known
140114 23:22:28 [Warning] IP address '118.192.7.10' could not be resolved: Name or service not known
140115  7:44:59 [Warning] IP address '198.13.101.242' could not be resolved: Temporary failure in name resolution
140115 22:40:14 [Warning] IP address '111.68.3.106' could not be resolved: Temporary failure in name resolution
140116  3:15:56 [Note] /usr/libexec/mysqld: Normal shutdown

140116  3:15:56 [Note] Event Scheduler: Purging the queue. 0 events
140116  3:15:56  InnoDB: Starting shutdown...
140116  3:15:58  InnoDB: Shutdown completed; log sequence number 7223004
140116  3:15:58 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:15:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:15:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:15:59 [Note] Plugin 'FEDERATED' is disabled.
140116  3:15:59 InnoDB: The InnoDB memory heap is disabled
140116  3:15:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:15:59 InnoDB: Compressed tables use zlib 1.2.5
140116  3:15:59 InnoDB: Using Linux native AIO
140116  3:15:59 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:15:59 InnoDB: Completed initialization of buffer pool
140116  3:15:59 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:15:59 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:15:59 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:15:59 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:15:59 [ERROR] Aborting

140116  3:15:59 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:15:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:16:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:16:30 [Note] Plugin 'FEDERATED' is disabled.
140116  3:16:30 InnoDB: The InnoDB memory heap is disabled
140116  3:16:30 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:16:30 InnoDB: Compressed tables use zlib 1.2.5
140116  3:16:30 InnoDB: Using Linux native AIO
140116  3:16:30 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:16:30 InnoDB: Completed initialization of buffer pool
140116  3:16:30 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:16:30 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:16:30 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:16:30 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:16:30 [ERROR] Aborting

140116  3:16:30 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:16:30 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:22:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:22:54 [Note] Plugin 'FEDERATED' is disabled.
140116  3:22:54 InnoDB: The InnoDB memory heap is disabled
140116  3:22:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:22:54 InnoDB: Compressed tables use zlib 1.2.5
140116  3:22:54 InnoDB: Using Linux native AIO
140116  3:22:54 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:22:54 InnoDB: Completed initialization of buffer pool
140116  3:22:54 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:22:54 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:22:54 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:22:54 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:22:54 [ERROR] Aborting

140116  3:22:54 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:22:54 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:25:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:25:03 [Note] Plugin 'FEDERATED' is disabled.
140116  3:25:03 InnoDB: The InnoDB memory heap is disabled
140116  3:25:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:25:03 InnoDB: Compressed tables use zlib 1.2.5
140116  3:25:03 InnoDB: Using Linux native AIO
140116  3:25:03 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:25:03 InnoDB: Completed initialization of buffer pool
140116  3:25:03 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:25:03 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:25:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:25:03 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:25:03 [ERROR] Aborting

140116  3:25:03 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:25:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:27:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:27:36 [Note] Plugin 'FEDERATED' is disabled.
140116  3:27:36 InnoDB: The InnoDB memory heap is disabled
140116  3:27:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:27:36 InnoDB: Compressed tables use zlib 1.2.5
140116  3:27:36 InnoDB: Using Linux native AIO
140116  3:27:36 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:27:36 InnoDB: Completed initialization of buffer pool
140116  3:27:36 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:27:36 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:27:36 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:27:36 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:27:36 [ERROR] Aborting

140116  3:27:36 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:27:36 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:37:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:37:37 [Note] Plugin 'FEDERATED' is disabled.
140116  3:37:37 InnoDB: The InnoDB memory heap is disabled
140116  3:37:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:37:37 InnoDB: Compressed tables use zlib 1.2.5
140116  3:37:37 InnoDB: Using Linux native AIO
140116  3:37:37 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:37:37 InnoDB: Completed initialization of buffer pool
140116  3:37:37 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:37:37 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:37:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:37:37 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:37:37 [ERROR] Aborting

140116  3:37:37 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:37:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:39:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:39:10 [Note] Plugin 'FEDERATED' is disabled.
140116  3:39:10 InnoDB: The InnoDB memory heap is disabled
140116  3:39:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:39:10 InnoDB: Compressed tables use zlib 1.2.5
140116  3:39:10 InnoDB: Using Linux native AIO
140116  3:39:10 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:39:10 InnoDB: Completed initialization of buffer pool
140116  3:39:10 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:39:10 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:39:10 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:39:10 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:39:10 [ERROR] Aborting

140116  3:39:10 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:39:10 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:40:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:40:03 [Note] Plugin 'FEDERATED' is disabled.
140116  3:40:03 InnoDB: The InnoDB memory heap is disabled
140116  3:40:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:40:03 InnoDB: Compressed tables use zlib 1.2.5
140116  3:40:03 InnoDB: Using Linux native AIO
140116  3:40:03 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:40:03 InnoDB: Completed initialization of buffer pool
140116  3:40:03 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:40:03 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:40:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:40:03 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:40:03 [ERROR] Aborting

140116  3:40:03 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:40:03 mysqld_safe mysqld from pid file /var/lib/mysqld/mysqld.pid ended
140116 03:41:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:41:28 [Note] Plugin 'FEDERATED' is disabled.
140116  3:41:28 InnoDB: The InnoDB memory heap is disabled
140116  3:41:28 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:41:28 InnoDB: Compressed tables use zlib 1.2.5
140116  3:41:28 InnoDB: Using Linux native AIO
140116  3:41:28 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:41:28 InnoDB: Completed initialization of buffer pool
140116  3:41:28 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:41:28 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:41:28 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:41:28 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:41:28 [ERROR] Aborting

140116  3:41:28 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:41:28 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:43:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:43:21 [Note] Plugin 'FEDERATED' is disabled.
140116  3:43:21 InnoDB: The InnoDB memory heap is disabled
140116  3:43:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:43:21 InnoDB: Compressed tables use zlib 1.2.5
140116  3:43:21 InnoDB: Using Linux native AIO
140116  3:43:21 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:43:21 InnoDB: Completed initialization of buffer pool
140116  3:43:21 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:43:21 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:43:21 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:43:21 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:43:21 [ERROR] Aborting

140116  3:43:21 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:43:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140116 03:44:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140116  3:44:43 [Note] Plugin 'FEDERATED' is disabled.
140116  3:44:43 InnoDB: The InnoDB memory heap is disabled
140116  3:44:43 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140116  3:44:43 InnoDB: Compressed tables use zlib 1.2.5
140116  3:44:43 InnoDB: Using Linux native AIO
140116  3:44:43 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:44:43 InnoDB: Completed initialization of buffer pool
140116  3:44:43 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140116  3:44:43 [ERROR] Plugin 'InnoDB' init function returned error.
140116  3:44:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140116  3:44:43 [ERROR] Unknown/unsupported storage engine: InnoDB
140116  3:44:43 [ERROR] Aborting

140116  3:44:43 [Note] /usr/libexec/mysqld: Shutdown complete

140116 03:44:43 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

我也試過升級mysql。

Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed 

這是日誌的重要部分:

140116  3:15:59 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140116  3:15:59 InnoDB: Completed initialization of buffer pool
140116  3:15:59 InnoDB: Fatal error: cannot allocate memory for the buffer pool

(Errno 12 是“無法分配記憶體”)

所以我們看到 MySQL 嘗試分配 128 MB 並沒有這樣做。這意味著您的實例沒有足夠的記憶體。

可能是您正在執行某些正在洩漏記憶體的東西,並且重新啟動實例將使您啟動並執行。

但更有可能的是,您需要遍歷所有程序並查看記憶體佔用情況,並適當調整它們以在微實例中執行,或升級實例大小。

引用自:https://serverfault.com/questions/567609