Cent OS-MySQL 守护进程启动失败

Cent OS-MySQL 守护进程启动失败

我正在运行具有 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 

答案1

这是重要的您的日志的一部分:

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 但失败了。这意味着您的实例没有足够的内存。

可能是您正在运行的某个程序泄漏了内存,重新启动实例就可以启动并运行。

但更有可能的是,您需要检查所有流程并查看哪些流程消耗了内存,然后适当调整它们以在微实例中运行,或者升级实例大小。

相关内容