【问题标题】:mysqld stops unexpectedly on t2.micro Amazon Linux instancemysqld 在 t2.micro Amazon Linux 实例上意外停止
【发布时间】:2015-09-15 14:17:07
【问题描述】:

我正在 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$

【问题讨论】:

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


    【解决方案1】:

    这是一个内存问题:

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

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

    【讨论】:

    • 我同意这里的 cmets 使用 RDS。
    • 非常感谢!我会用一个更大的实例来看看 RDS!
    猜你喜欢
    • 1970-01-01
    • 2018-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-29
    相关资源
    最近更新 更多