【问题标题】:MYsql Shut down often for no reason and unable restart afterMYsql经常无缘无故关机后无法重启
【发布时间】:2015-05-05 10:32:07
【问题描述】:
150505 16:57:01 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
150505 16:58:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150505 16:58:01 [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.
150505 16:58:01 [Note] Plugin 'FEDERATED' is disabled.
150505 16:58:01 InnoDB: The InnoDB memory heap is disabled
150505 16:58:01 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150505 16:58:01 InnoDB: Compressed tables use zlib 1.2.8
150505 16:58:01 InnoDB: Using Linux native AIO
150505 16:58:01 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
150505 16:58:01 InnoDB: Completed initialization of buffer pool
150505 16:58:01 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150505 16:58:01 [ERROR] Plugin 'InnoDB' init function returned error.
150505 16:58:01 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150505 16:58:01 [ERROR] Unknown/unsupported storage engine: InnoDB
150505 16:58:01 [ERROR] Aborting

上面是mysql错误日志,有时mysql会崩溃,我想重新启动服务,它无法启动,错误类似于 “未知实例”错误。

任何人都知道上面的错误是什么以及如何解决它,我尝试了谷歌但似乎无法找到答案。

谢谢!

【问题讨论】:

  • 您是否有足够的可用 RAM/交换空间?您可以尝试将 innodb_buffer_pool_size 减小到 64 MB。

标签: mysql error-handling


【解决方案1】:

我自己在寻找答案时发现了这个问题,我的服务器的/var/log/mysql/error.log 与您的陈述非常相似。运行dmesg | tail -20 发现罪魁祸首:操作系统内存不足,杀死mysqld

[835661.446277] Out of memory: Kill process 1024 (mysqld) score 91 or sacrifice child
[835661.446912] Killed process 1024 (mysqld) total-vm:901544kB, anon-rss:92332kB, file-rss:0kB
[835661.488337] init: mysql main process (1024) killed by KILL signal

现在要弄清楚为什么在这台较新的服务器上内存用完了,它的 RAM 是它要替换的服务器的两倍,而这从未发生过这种情况...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-07-01
    • 2018-08-17
    • 2022-11-20
    • 1970-01-01
    • 2017-04-11
    • 1970-01-01
    • 2023-04-03
    相关资源
    最近更新 更多