运行中的 mysql 突然关闭了 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
test523
V2EX    MySQL

运行中的 mysql 突然关闭了

  •  
  •   test523 2018-11-15 11:41:28 +08:00 3734 次点击
    这是一个创建于 2593 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 nubers 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 吗?

    第 1 条附言    2018-11-15 12:54:51 +08:00

    messages 里面还真有OOM,,很大一段,,内存不足 数据库被kill了,,谢谢2位大佬

    Nov 15 10:50:14 VM_125_204_centos kernel: [ 7601] 0 7601 14708 62 26 0 0 php Nov 15 10:50:14 VM_125_204_centos kernel: [ 7602] 0 7602 28280 52 12 0 0 bash Nov 15 10:50:14 VM_125_204_centos kernel: [ 7603] 0 7603 30829 685 16 0 0 python Nov 15 10:50:14 VM_125_204_centos kernel: [ 7604] 0 7604 14708 62 24 0 0 php Nov 15 10:50:14 VM_125_204_centos kernel: [ 7605] 0 7605 14708 63 26 0 0 php Nov 15 10:50:14 VM_125_204_centos kernel: [ 7620] 0 7620 14708 62 25 0 0 php Nov 15 10:50:14 VM_125_204_centos kernel: Out of memory: Kill process 5810 (mysqld) score 164 or sacrifice child Nov 15 10:50:14 VM_125_204_centos kernel: Killed process 5810 (mysqld) total-vm:4259884kB, anon-rss:1316636kB, file-rss:0kB, shmem-rss:0kB 
    4 条回复    2018-11-16 08:20:41 +08:00
    msg7086
        1
    msg7086  
       2018-11-15 11:46:49 +08:00   1
    是因为内存不足,导致数据库被内核结束进程。
    Aliencn
        2
    Aliencn  
       2018-11-15 12:11:39 +08:00   1
    看 message 日志里面有没有 OOM 的记录
    test523
        3
    test523  
    OP
       2018-11-15 12:55:46 +08:00
    @msg7086
    @Aliencn

    看了 messages,还真是因为内存不足,,导致数据库进程被 kill 了。
    julyclyde
        4
    julyclyde  
       2018-11-16 08:20:41 +08:00
    @msg7086 赞经验丰富!
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2482 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 10:58 PVG 18:58 LAX 02:58 JFK 05:58
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86