I have an Amazon ec2 micro instance that holds a WordPress site. Since yesterday, my mysql db keep crashing saying:
我有一个Amazon ec2微实例,它包含一个WordPress站点。从昨天开始,我的mysql db一直在崩溃:
[ec2-user@ip-xxx-xx-xx-xxx ~]$ sudo service mysqld status
mysqld dead but subsys locked
I tried restarting the mysqld but after every 5 mins it keeps crashing with the same message - "Error establishing a database connection"
我尝试重新启动mysqld,但是每5分钟就会有一个相同的消息——“建立数据库连接出错”
This is what my DB log file reads -
这是我的DB日志文件读-
160123 05:44:41 mysqld_safe mysqld restarted
160123 5:44:43 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 7928 ...
160123 5:44:44 [Note] Plugin 'FEDERATED' is disabled.
160123 5:44:46 InnoDB: The InnoDB memory heap is disabled
160123 5:44:46 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160123 5:44:46 InnoDB: Compressed tables use zlib 1.2.8
160123 5:44:46 InnoDB: Using Linux native AIO
160123 5:44:46 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
160123 5:44:46 InnoDB: Completed initialization of buffer pool
160123 5:44:46 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160123 5:44:46 [ERROR] Plugin 'InnoDB' init function returned error.
160123 5:44:46 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160123 5:44:46 [ERROR] Unknown/unsupported storage engine: InnoDB
160123 5:44:46 [ERROR] Aborting
160123 5:44:46 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
160123 05:44:46 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
The common solution that found out there when I Googled for a solution for the issue - mysqld dead but subsys locked
, is to create a swapfile. I did exactly as most of the solution suggest but since I'm not well versed with UNIX, I don't know what I have done is right or not.
当我在谷歌上搜索这个问题的解决方案时,常见的解决方案是创建一个swapfile。我按照大多数解决方案的建议做了,但是由于我不熟悉UNIX,所以我不知道我所做的是否正确。
Or, Is there any other solution for this issue. Kindly help.
或者,这个问题还有其他的解决办法吗?请帮助。
1 个解决方案
#1
2
Have you tried this mysql is dead but subsys locked
你试过这个mysql死而subsys锁了吗
Seems quite straightforward. Also please consider moving to RDS instead of running a mysql server in ec2. Saves you from troubles of this kind.
似乎很简单。另外,请考虑迁移到RDS,而不是在ec2中运行mysql服务器。把你从这种麻烦中解救出来。
#1
2
Have you tried this mysql is dead but subsys locked
你试过这个mysql死而subsys锁了吗
Seems quite straightforward. Also please consider moving to RDS instead of running a mysql server in ec2. Saves you from troubles of this kind.
似乎很简单。另外,请考虑迁移到RDS,而不是在ec2中运行mysql服务器。把你从这种麻烦中解救出来。