mysqld在t2.micro Amazon Linux实例

时间:2015-06-29 07:39:40

标签: mysql linux wordpress amazon-web-services amazon-ec2

我正在EC2上运行t2.micro Amazon Linux实例。我在上面安装了LAMP和Wordpress。

每次我睡觉/外出之前,我每次通过ssh将终端连接到我的实例时,我都遇到了许多意想不到的mysqld关闭。当我醒来/回到家时,mysqld总是关闭自己。 (而且我不确定这是否与自我停止问题有关。)或者这是一个记忆问题? (t2.micro实例仅提供1GB内存)

每次mysqld关闭时,我配置的文件权限都消失了,每次重新应用文件权限都很烦人。

我刚开始使用这些服务器设置的东西,我还是个新手...... 有人可以帮助我并告诉我如何防止未来的mysqld自动关闭,即使我打开了终端连接,我该怎么配置它以便我不必在关闭后重新应用文件权限下?

这是来自mysqld的日志:

150627 18:02:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150627 18:02:22 InnoDB: Compressed tables use zlib 1.2.7
150627 18:02:22 InnoDB: Using Linux native AIO
150627 18:02:22 InnoDB: Initializing buffer pool, size = 128.0M
150627 18:02:22 InnoDB: Completed initialization of buffer pool
150627 18:02:22 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 10566571
150627 18:02:22 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 10566581
150627 18:02:22 InnoDB: Waiting for the background threads to start
150627 18:02:23 InnoDB: 5.5.42 started; log sequence number 10566581
150627 18:02:23 Note Server hostname (bind-address): '0.0.0.0'; port: 3306
150627 18:02:23 Note - '0.0.0.0' resolves to '0.0.0.0';
150627 18:02:23 Note Server socket created on IP: '0.0.0.0'.
150627 18:02:23 Note Event Scheduler: Loaded 0 events
150627 18:02:23 Note Server socket created on IP: '0.0.0.0'.
150627 18:02:23 Note Event Scheduler: Loaded 0 events
150627 18:02:23 Note /usr/libexec/mysqld: ready for connections.
Version: '5.5.42' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Commu$
mysqld_safe Number of processes running now:
150628 18:18:29 mysqld_safe mysqld restarted
/usr/bin/mysqld_safe: line 165: /usr/bin/nohup: Cannot allocate memory
150628 18:22:53 mysqld_safe Starting mysqld daemon with databases from /var/lib$
150628 18:22:53 Note Plugin 'FEDERATED' is disabled.
150628 18:22:53 InnoDB: The InnoDB memory heap is disabled
150628 18:22:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150628 18:22:53 InnoDB: Compressed tables use zlib 1.2.7
150628 18:22:53 InnoDB: Using Linux native AIO
150628 18:22:53 InnoDB: Initializing buffer pool, size = 128.0M
150628 18:22:53 InnoDB: Completed initialization of buffer pool
150628 18:22:53 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
150628 18:22:53 InnoDB: Database was not shut down normally!
InnoDB: the log sequence number in the ib_logfiles!
150628 18:22:53 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
150628 18:22:54 InnoDB: Waiting for the background threads to start
150628 18:22:55 InnoDB: 5.5.42 started; log sequence number 11269379
150628 18:22:55 Note Server hostname (bind-address): '0.0.0.0'; port: 3306
150628 18:22:55 Note - '0.0.0.0' resolves to '0.0.0.0';
150628 18:22:55 Note Server socket created on IP: '0.0.0.0'.
150628 18:22:55 Note Event Scheduler: Loaded 0 events
150628 18:22:55 Note /usr/libexec/mysqld: ready for connections.
Version: '5.5.42' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Commu$
150628 18:28:10 mysqld_safe Number of processes running now: 0
150628 18:28:13 mysqld_safe mysqld restarted
/usr/libexec/mysqld: error while loading shared libraries: libkrb5.so.3: failed$

1 个答案:

答案 0 :(得分:2)

这是一个记忆问题:

/usr/bin/mysqld_safe: line 165: /usr/bin/nohup: Cannot allocate memory

您可以使用MySQL设置来尝试解决问题,但只使用更大的实例类型会更容易。您还可以使用RDS free tier在专用服务器上托管MySQL数据库,并获得免费备份。

相关问题