VPS侦探论坛

 找回密码
 注册
查看: 4877|回复: 5

LNMPA mysql服务运行几个小时后总是自动挂掉,系统重做好多次了,总是搞不定,求救!

[复制链接]
发表于 2015-12-16 08:30:37 | 显示全部楼层 |阅读模式

Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-32-generic x86_64)512M内存,
只装了LNMPAmysql启用innoDB,更改了MySQL的数据库存放目录,innodb_data_home_dir 和innodb_log_group_home_dir地址
同步修改清理并禁用mysql-bin.00001日志文件,
my.cnf文件[mysqld]下增加下面配置innodb_file_per_table=1
一开始一起运行正常,过几个小时后mysql就会自动挂掉,
重启之后正常运行,过几个小时后mysql又自动挂掉
mysql出错日志如下,请高手帮忙指点一下

151215 23:25:06 mysqld_safe mysqld from pid file /mnt/data/AY1404082155398856bcZ.pid ended
151215 23:25:08 mysqld_safe Starting mysqld daemon with databases from /mnt/data
151215 23:25:08 InnoDB: The InnoDB memory heap is disabled
151215 23:25:08 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151215 23:25:08 InnoDB: Compressed tables use zlib 1.2.8
151215 23:25:08 InnoDB: Initializing buffer pool, size = 16.0M
151215 23:25:08 InnoDB: Completed initialization of buffer pool
151215 23:25:08 InnoDB: highest supported file format is Barracuda.
151215 23:25:08  InnoDB: Waiting for the background threads to start
151215 23:25:09 InnoDB: 5.5.42 started; log sequence number 696396357
151215 23:25:09 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
151215 23:25:09 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
151215 23:25:09 [Note] Server socket created on IP: '0.0.0.0'.
151215 23:25:09 [Note] Event Scheduler: Loaded 0 events
151215 23:25:09 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.42'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
Killed
151216 02:31:45 mysqld_safe Number of processes running now: 0
151216 02:31:45 mysqld_safe mysqld restarted
151216  2:31:45 InnoDB: The InnoDB memory heap is disabled
151216  2:31:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151216  2:31:45 InnoDB: Compressed tables use zlib 1.2.8
151216  2:31:45 InnoDB: Initializing buffer pool, size = 16.0M
151216  2:31:45 InnoDB: Completed initialization of buffer pool
151216  2:31:45 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!
151216  2:31:45  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...
151216  2:31:46  InnoDB: Waiting for the background threads to start
151216  2:31:47 InnoDB: 5.5.42 started; log sequence number 697241756
151216  2:31:47 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
151216  2:31:47 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
151216  2:31:47 [Note] Server socket created on IP: '0.0.0.0'.
151216  2:31:48 [Note] Event Scheduler: Loaded 0 events
151216  2:31:48 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.42'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
Killed
151216 02:33:44 mysqld_safe Number of processes running now: 0
151216 02:33:44 mysqld_safe mysqld restarted
151216  2:33:44 InnoDB: The InnoDB memory heap is disabled
151216  2:33:44 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151216  2:33:44 InnoDB: Compressed tables use zlib 1.2.8
151216  2:33:44 InnoDB: Initializing buffer pool, size = 16.0M
151216  2:33:44 InnoDB: Completed initialization of buffer pool
151216  2:33:44 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!
151216  2:33:44  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...
151216  2:33:45  InnoDB: Waiting for the background threads to start
151216  2:33:46 InnoDB: 5.5.42 started; log sequence number 697241766
151216  2:33:46 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
151216  2:33:46 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
151216  2:33:48 [Note] Server socket created on IP: '0.0.0.0'.
151216  2:35:20 [Note] Event Scheduler: Loaded 0 events
151216  2:35:20 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.42'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
Killed
151216 02:35:40 mysqld_safe Number of processes running now: 0
151216 02:35:40 mysqld_safe mysqld restarted
151216  2:35:40 InnoDB: The InnoDB memory heap is disabled
151216  2:35:40 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151216  2:35:40 InnoDB: Compressed tables use zlib 1.2.8
151216  2:35:40 InnoDB: Initializing buffer pool, size = 16.0M
151216  2:35:40 InnoDB: Completed initialization of buffer pool
151216  2:35:40 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!
151216  2:35:40  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...
151216  2:35:43  InnoDB: Waiting for the background threads to start
151216  2:35:44 InnoDB: 5.5.42 started; log sequence number 697241776
151216  2:35:44 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
151216  2:35:44 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
151216  2:35:44 [Note] Server socket created on IP: '0.0.0.0'.
151216  2:35:44 [Note] Event Scheduler: Loaded 0 events
151216  2:35:44 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.42'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
Killed
151216 02:59:39 mysqld_safe Number of processes running now: 0
151216 02:59:39 mysqld_safe mysqld restarted
151216  2:59:39 InnoDB: The InnoDB memory heap is disabled
151216  2:59:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151216  2:59:39 InnoDB: Compressed tables use zlib 1.2.8
151216  2:59:39 InnoDB: Initializing buffer pool, size = 16.0M
InnoDB: mmap(17170432 bytes) failed; errno 12
151216  2:59:39 InnoDB: Completed initialization of buffer pool
151216  2:59:39 InnoDB: Fatal error: cannot allocate memory for the buffer pool
151216  2:59:39 [ERROR] Plugin 'InnoDB' init function returned error.
151216  2:59:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151216  2:59:39 [ERROR] Unknown/unsupported storage engine: InnoDB
151216  2:59:39 [ERROR] Aborting

151216  2:59:39 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

151216 02:59:39 mysqld_safe mysqld from pid file /mnt/data/AY1404082155398856bcZ.pid ended
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-16 09:12:54 | 显示全部楼层


前面日志里只有Killed,应该是内存不足被系统kill了

InnoDB: mmap(17170432 bytes) failed; errno 12
151216  2:59:39 InnoDB: Completed initialization of buffer pool
151216  2:59:39 InnoDB: Fatal error: cannot allocate memory for the buffer pool

后面日志也有无法分配内存的提示
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-12-16 13:27:54 | 显示全部楼层

为什么会这样? 难道512M内存不能支持LNMPA吗
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-16 13:42:51 | 显示全部楼层

回复 3# 的帖子




512MB运行lnmpa确实内存挺紧张
最好是1G以上
本身apache就挺能吃内存的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-12-17 18:53:07 | 显示全部楼层

果然是,换成lnmp一切正常,伤心呀!用不了lnmpa

军哥运维代购:http://shop63846532.taobao.com/

发表于 2015-12-18 09:09:55 | 显示全部楼层

我也有512的,很稳定
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 12:59 , Processed in 0.027049 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表