mariadb 内核崩溃导致服务无法启动

数据库宕机无法启动
通过journalctl -xeu mariadb
查看日志如下

May 03 17:19:31 zabbix mysqld[52493]: thread_count=0
May 03 17:19:31 zabbix mysqld[52493]: max_threads=2002
May 03 17:19:31 zabbix mysqld[52493]: thread_count=0
May 03 17:19:31 zabbix mysqld[52493]: It is possible that mysqld could use up to
May 03 17:19:31 zabbix mysqld[52493]: It is possible that mysqld could use up to
May 03 17:19:31 zabbix mysqld[52493]: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4536823 K  bytes of memory
May 03 17:19:31 zabbix mysqld[52493]: Hope that's ok; if not, decrease some variables in the equation.
May 03 17:19:31 zabbix mysqld[52493]: Thread pointer: 0x0
May 03 17:19:31 zabbix mysqld[52493]: Attempting backtrace. You can use the following information to find out
May 03 17:19:31 zabbix mysqld[52493]: where mysqld died. If you see no messages after this, something went
May 03 17:19:31 zabbix mysqld[52493]: terribly wrong...
May 03 17:19:31 zabbix mysqld[52493]: stack_bottom = 0x0 thread_stack 0x49000
May 03 17:19:31 zabbix mysqld[52493]: 2020-05-03 17:19:31 0 [Note] InnoDB: Completed initialization of buffer pool
May 03 17:19:31 zabbix mysqld[52493]: 2020-05-03 17:19:31 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be ch
May 03 17:19:31 zabbix mysqld[52493]: 2020-05-03 17:19:31 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=252665991
May 03 17:19:31 zabbix mysqld[52493]: 2020-05-03 17:19:31 0 [Note] InnoDB: Transaction 592213 was in the XA prepared state.
May 03 17:19:31 zabbix mysqld[52493]: 2020-05-03 17:19:31 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 0 row operations
May 03 17:19:31 zabbix mysqld[52493]: 2020-05-03 17:19:31 0 [Note] InnoDB: Trx id counter is 592214
May 03 17:19:31 zabbix mysqld[52493]: 2020-05-03 17:19:31 0 [Note] InnoDB: Starting final batch to recover 7 pages from redo log.
May 03 17:19:31 zabbix mysqld[52493]: 200503 17:19:31 [ERROR] mysqld got signal 11 ;
May 03 17:19:31 zabbix mysqld[52493]: This could be because you hit a bug. It is also possible that this binary
May 03 17:19:31 zabbix mysqld[52493]: or one of the libraries it was linked against is corrupt, improperly built,
May 03 17:19:31 zabbix mysqld[52493]: or misconfigured. This error can also be caused by malfunctioning hardware.
May 03 17:19:31 zabbix mysqld[52493]: To report this bug, see https://mariadb.com/kb/en/reporting-bugs
May 03 17:19:31 zabbix mysqld[52493]: We will try our best to scrape up some info that will hopefully help
May 03 17:19:31 zabbix mysqld[52493]: diagnose the problem, but since we have already crashed,
May 03 17:19:31 zabbix mysqld[52493]: something is definitely wrong and this may fail.
May 03 17:19:31 zabbix mysqld[52493]: Server version: 10.4.12-MariaDB-log
May 03 17:19:31 zabbix mysqld[52493]: key_buffer_size=134217728
May 03 17:19:31 zabbix mysqld[52493]: read_buffer_size=131072
May 03 17:19:31 zabbix mysqld[52493]: max_used_connections=0
May 03 17:19:31 zabbix mysqld[52493]: max_threads=2002
May 03 17:19:31 zabbix mysqld[52493]: thread_count=0
May 03 17:19:31 zabbix mysqld[52493]: It is possible that mysqld could use up to
May 03 17:19:31 zabbix mysqld[52493]: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4536823 K  bytes of memory
May 03 17:19:31 zabbix mysqld[52493]: Hope that's ok; if not, decrease some variables in the equation.
May 03 17:19:31 zabbix mysqld[52493]: Thread pointer: 0x0
May 03 17:19:31 zabbix mysqld[52493]: Attempting backtrace. You can use the following information to find out
May 03 17:19:31 zabbix mysqld[52493]: where mysqld died. If you see no messages after this, something went
May 03 17:19:31 zabbix mysqld[52493]: terribly wrong...
May 03 17:19:31 zabbix mysqld[52493]: stack_bottom = 0x0 thread_stack 0x49000
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x55c5c3a31a1e]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(handle_fatal_signal+0x30f)[0x55c5c34c5d8f]
May 03 17:19:31 zabbix mysqld[52493]: sigaction.c:0(__restore_rt)[0x7f99312515d0]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0xae4b64)[0x55c5c36ecb64]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0xae671d)[0x55c5c36ee71d]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0xac60f5)[0x55c5c36ce0f5]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0xac828f)[0x55c5c36d028f]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0x5ad337)[0x55c5c31b5337]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0xbf7462)[0x55c5c37ff462]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0xc5f9cf)[0x55c5c38679cf]
May 03 17:19:31 zabbix mysqld[52493]: /usr/sbin/mysqld(+0xb6ddd8)[0x55c5c3775dd8]
May 03 17:19:31 zabbix mysqld[52493]: pthread_create.c:0(start_thread)[0x7f9931249dd5]
May 03 17:19:31 zabbix mysqld[52493]: /lib64/libc.so.6(clone+0x6d)[0x7f992f5ecead]
May 03 17:19:31 zabbix mysqld[52493]: The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
May 03 17:19:31 zabbix mysqld[52493]: information that should help you find out what is causing the crash.
May 03 17:19:31 zabbix kernel: mysqld[52499]: segfault at 0 ip 000055c5c3a2ec28 sp 00007f98ff7faeb0 error 6 in mysqld[55c5c2c08000+1483000]
May 03 17:19:31 zabbix mysqld[52493]: Writing a core file...
May 03 17:19:31 zabbix mysqld[52493]: Working directory at /var/lib/mysql
May 03 17:19:31 zabbix mysqld[52493]: Resource Limits:
May 03 17:19:31 zabbix systemd[1]: mariadb.service: main process exited, code=killed, status=11/SEGV
May 03 17:19:31 zabbix systemd[1]: Failed to start MariaDB 10.4.12 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is failed.
May 03 17:19:31 zabbix systemd[1]: Unit mariadb.service entered failed state.
May 03 17:19:31 zabbix systemd[1]: mariadb.service failed.

通过systemctl status mariadb 查看如下

# systemctl status mariadb
● mariadb.service - MariaDB 10.4.12 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: activating (start) since Sun 2020-05-03 17:22:38 CST; 277ms ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 54301 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 54298 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 54327 (mysqld)
   Status: "Starting final batch to recover 7 pages from redo log"
   CGroup: /system.slice/mariadb.service
           └─54327 /usr/sbin/mysqld

May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Number of pools: 1
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Using SSE2 crc32 instructions
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Completed initialization of buffer pool
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priori...iority().
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=252665991
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Transaction 592213 was in the XA prepared state.
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 0 ro...s to undo
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Trx id counter is 592214
May 03 17:22:38 zabbix mysqld[54327]: 2020-05-03 17:22:38 0 [Note] InnoDB: Starting final batch to recover 7 pages from redo log.
May 03 17:22:38 zabbix mysqld[54327]: 200503 17:22:38 [ERROR] mysqld got signal 11 ;
May 03 17:22:38 zabbix mysqld[54327]: This could be because you hit a bug. It is also possible that this binary
Hint: Some lines were ellipsized, use -l to show in full.

得到关键 信息
Starting final batch to recover 7 pages from redo log

通过百般搜索 找到下列同样案例
https://serverfault.com/questions/592793/mysql-crashed-and-wont-start-up

最终通过修改数据 [mysqld]
添加
innodb_force_recovery = 6
innodb_purge_threads = 0

启动成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值