运行中的 mysql 突然关闭了

2018-11-15 11:41:28 +08:00
 guangzhouwuyanzu
2018-11-15 10:30:35 3452 [Note] Plugin 'FEDERATED' is disabled.
2018-11-15 10:30:35 3452 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-11-15 10:30:35 3452 [Note] InnoDB: The InnoDB memory heap is disabled
2018-11-15 10:30:35 3452 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-11-15 10:30:35 3452 [Note] InnoDB: Memory barrier is not used
2018-11-15 10:30:35 3452 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-11-15 10:30:35 3452 [Note] InnoDB: Using CPU crc32 instructions
2018-11-15 10:30:35 3452 [Note] InnoDB: Initializing buffer pool, size = 512.0M
2018-11-15 10:30:35 3452 [Note] InnoDB: Completed initialization of buffer pool
2018-11-15 10:30:35 3452 [Note] InnoDB: Highest supported file format is Barracuda.
2018-11-15 10:30:36 3452 [Note] InnoDB: The log sequence numbers 329132395 and 329132395 in ibdata files do not match the log sequence number 341178818 in the ib_logfiles!
2018-11-15 10:30:36 3452 [Note] InnoDB: Database was not shutdown normally!
2018-11-15 10:30:36 3452 [Note] InnoDB: Starting crash recovery.
2018-11-15 10:30:36 3452 [Note] InnoDB: Reading tablespace information from the .ibd files...
2018-11-15 10:30:39 3452 [Note] InnoDB: Restoring possible half-written data pages 
2018-11-15 10:30:39 3452 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 8014580, file name mysql-bin.000044
2018-11-15 10:30:41 3452 [Note] InnoDB: 128 rollback segment(s) are active.
2018-11-15 10:30:41 3452 [Note] InnoDB: Waiting for purge to start
2018-11-15 10:30:41 3452 [Note] InnoDB: 5.6.36 started; log sequence number 341178818
2018-11-15 10:30:41 3452 [Note] Recovering after a crash using mysql-bin
2018-11-15 10:30:41 3452 [Note] Starting crash recovery...
2018-11-15 10:30:41 3452 [Note] Crash recovery finished.
2018-11-15 10:30:42 3452 [Note] Server hostname (bind-address): '*'; port: 4580
2018-11-15 10:30:42 3452 [Note] IPv6 is available.
2018-11-15 10:30:42 3452 [Note]   - '::' resolves to '::';
2018-11-15 10:30:42 3452 [Note] Server socket created on IP: '::'.
2018-11-15 10:30:42 3452 [Note] Event Scheduler: Loaded 0 events
2018-11-15 10:30:42 3452 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.6.36-log'  socket: '/tmp/mysql.sock'  port: 4580  Source distribution
2018-11-15 10:40:16 5810 [Note] Plugin 'FEDERATED' is disabled.
2018-11-15 10:40:16 5810 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-11-15 10:40:16 5810 [Note] InnoDB: The InnoDB memory heap is disabled
2018-11-15 10:40:16 5810 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-11-15 10:40:16 5810 [Note] InnoDB: Memory barrier is not used
2018-11-15 10:40:16 5810 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-11-15 10:40:16 5810 [Note] InnoDB: Using CPU crc32 instructions
2018-11-15 10:40:16 5810 [Note] InnoDB: Initializing buffer pool, size = 512.0M
2018-11-15 10:40:16 5810 [Note] InnoDB: Completed initialization of buffer pool
2018-11-15 10:40:16 5810 [Note] InnoDB: Highest supported file format is Barracuda.
2018-11-15 10:40:16 5810 [Note] InnoDB: The log sequence numbers 329132395 and 329132395 in ibdata files do not match the log sequence number 341499308 in the ib_logfiles!
2018-11-15 10:40:16 5810 [Note] InnoDB: Database was not shutdown normally!
2018-11-15 10:40:16 5810 [Note] InnoDB: Starting crash recovery.
2018-11-15 10:40:16 5810 [Note] InnoDB: Reading tablespace information from the .ibd files...
2018-11-15 10:40:18 5810 [Note] InnoDB: Restoring possible half-written data pages 
2018-11-15 10:40:18 5810 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 272993, file name mysql-bin.000045
2018-11-15 10:40:19 5810 [Note] InnoDB: 128 rollback segment(s) are active.
2018-11-15 10:40:19 5810 [Note] InnoDB: Waiting for purge to start
2018-11-15 10:40:19 5810 [Note] InnoDB: 5.6.36 started; log sequence number 341499308
2018-11-15 10:40:19 5810 [Note] Recovering after a crash using mysql-bin
2018-11-15 10:40:19 5810 [Note] Starting crash recovery...
2018-11-15 10:40:19 5810 [Note] Crash recovery finished.
2018-11-15 10:40:20 5810 [Note] Server hostname (bind-address): '*'; port: 4580
2018-11-15 10:40:20 5810 [Note] IPv6 is available.
2018-11-15 10:40:20 5810 [Note]   - '::' resolves to '::';
2018-11-15 10:40:20 5810 [Note] Server socket created on IP: '::'.
2018-11-15 10:40:20 5810 [Note] Event Scheduler: Loaded 0 events
2018-11-15 10:40:20 5810 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.6.36-log'  socket: '/tmp/mysql.sock'  port: 4580  Source distribution
2018-11-15 10:50:15 7647 [Note] Plugin 'FEDERATED' is disabled.
2018-11-15 10:50:15 7647 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-11-15 10:50:15 7647 [Note] InnoDB: The InnoDB memory heap is disabled
2018-11-15 10:50:15 7647 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-11-15 10:50:15 7647 [Note] InnoDB: Memory barrier is not used
2018-11-15 10:50:15 7647 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-11-15 10:50:15 7647 [Note] InnoDB: Using CPU crc32 instructions
2018-11-15 10:50:15 7647 [Note] InnoDB: Initializing buffer pool, size = 512.0M
2018-11-15 10:50:15 7647 [Note] InnoDB: Completed initialization of buffer pool
2018-11-15 10:50:15 7647 [Note] InnoDB: Highest supported file format is Barracuda.
2018-11-15 10:50:15 7647 [Note] InnoDB: The log sequence numbers 329132395 and 329132395 in ibdata files do not match the log sequence number 341872567 in the ib_logfiles!
2018-11-15 10:50:15 7647 [Note] InnoDB: Database was not shutdown normally!
2018-11-15 10:50:15 7647 [Note] InnoDB: Starting crash recovery.
2018-11-15 10:50:15 7647 [Note] InnoDB: Reading tablespace information from the .ibd files...
2018-11-15 10:50:18 7647 [Note] InnoDB: Restoring possible half-written data pages 
2018-11-15 10:50:18 7647 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 349361, file name mysql-bin.000046

错误日志如上 zabbix 监控到内存 Lack of available memory

然后数据库就自动关闭了,是因为内存的不足,导致 do not match the log sequence 吗?

3230 次点击
所在节点    MySQL
4 条回复
msg7086
2018-11-15 11:46:49 +08:00
是因为内存不足,导致数据库被内核结束进程。
Aliencn
2018-11-15 12:11:39 +08:00
看 message 日志里面有没有 OOM 的记录
guangzhouwuyanzu
2018-11-15 12:55:46 +08:00
@msg7086
@Aliencn

看了 messages,还真是因为内存不足,,导致数据库进程被 kill 了。
julyclyde
2018-11-16 08:20:41 +08:00
@msg7086 赞经验丰富!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/508077

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX