简体   繁体   English

无法启动 MySQL 社区服务器 -> InnoDB 强制恢复错误 -> InnoDB mmamp 错误

[英]Failed to start MySQL Community Server -> InnoDB Force Recovery error -> InnoDB mmamp error

I am running a AWS Lightsail instance with Ubuntu 18.04 and latest MySQL.我正在使用 Ubuntu 18.04 和最新的 MySQL 运行 AWS Lightsail 实例。 Since a few days, the MySQL service stops at random times and then forces me to perform a manual restart after which everything goes back to normal for 24-48 hours until I face another stop.几天后,MySQL 服务随机停止,然后强制我执行手动重启,之后一切恢复正常 24-48 小时,直到我再次停止。

Terminal echoes this error when running sudo service mysql status :终端在运行sudo service mysql status时回显此错误:

    ● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2020-04-26 17:54:44 UTC; 10h ago
  Process: 30117 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
  Process: 30095 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 14182 (code=killed, signal=KILL)

Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: Failed to start MySQL Community Server.
Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 8.
Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: Stopped MySQL Community Server.
Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: mysql.service: Start request repeated too quickly.
Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 26 17:54:44 ip-172-26-4-241 systemd[1]: Failed to start MySQL Community Server.

After digging through the /var/log/mysql/error.log file, I found dozens of lines like this: /var/log/mysql/error.log文件后,我发现有几十行是这样的:

2020-04-26T10:10:46.710146Z 2 [ERROR] InnoDB: innodb_force_recovery is on. We do not allow database modifications by the user. Shut down mysqld and edit my.cnf to$

Since the error message is truncated at exactly the wrong spot, I did some more digging through other Warning messages and found this one:由于错误消息在完全错误的位置被截断,因此我对其他Warning消息进行了更多挖掘,并找到了这个:

2020-04-26T17:54:44.312663Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2020-04-26T17:54:44.312671Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2020-04-26T17:54:44.312675Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-04-26T17:54:44.312680Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-04-26T17:54:44.312684Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-04-26T17:54:44.312688Z 0 [ERROR] Failed to initialize builtin plugins.
2020-04-26T17:54:44.312691Z 0 [ERROR] Aborting

I am by no means a MySQL expert, but I interpret that mmamp error as the system running out of space, which is a little weird since the instance uses around 10% space and has at most 2 users at the same time (hence little to no CPU usage).我绝不是 MySQL 专家,但我将 mmamp 错误解释为系统空间不足,这有点奇怪,因为实例使用了大约 10% 的空间并且同时最多有 2 个用户(因此很少没有 CPU 使用率)。 I run a single site Wordpress installation (just to divert users) and phpmyadmin plus some minor testing scripts.我运行单个站点 Wordpress 安装(只是为了转移用户)和 phpmyadmin 以及一些小测试脚本。

Appreciate any help with this, thank you.感谢您对此的任何帮助,谢谢。

The most likely cause is that your configuration is broken in a way that makes mysqld try to allocate more memory that your server has.最可能的原因是您的配置被破坏,导致 mysqld 尝试分配服务器拥有的更多 memory。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM