这是我们为客户管理的生产实例 (EC2)。停机时间已达 5 小时。我完蛋了。
故事
今天早上,我发现我们的一个客户端 mysqld 进程处于终止状态。我照做了sudo service mysql start
,然后将其启动并运行。
日志显示这是由于表崩溃而发生的。在查阅了网上的一些参考资料后,我执行了以下命令:
# mysqld was running
$ mysqlrepair -A --auto-repair
$ mysqlrepair -A -o
# By the time the following command was executed, mysqld had stopped
$ mysqlrepair -A -c
从此以后,以下命令拒绝启动 mysqld
$ sudo service mysql start
start: Job failed to start
$ sudo mysqld --verbose
$ ps aux | grep mysql
ubuntu 24124 0.0 0.1 8108 936 pts/0 S+ 04:07 0:00 grep --color=auto mysql
$ sudo mysqld_safe
131130 04:09:02 mysqld_safe Logging to '/var/log/mysql/error.log'.
131130 04:09:02 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
131130 04:09:02 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
/var/log/mysql/error.log 中没有当前时间戳的任何内容。
$ dmesg | grep mysql
[776212.640137] init: mysql main process (24070) terminated with status 1
[776212.640189] init: mysql main process ended, respawning
[776213.629832] init: mysql post-start process (24071) terminated with status 1
[776213.650730] type=1400 audit(1385784344.772:92): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=24094 comm="apparmor_parser"
[776213.745904] init: mysql main process (24098) terminated with status 1
[776213.745957] init: mysql respawning too fast, stopped
答案1
通过在 my.cnf 中添加以下内容解决了该问题:
innodb_buffer_pool_size = 16M
参考Mike的回答:
https://askubuntu.com/questions/127264/cant-start-mysql-mysql-respawning-too-fast-stopped