CentOS Linux 7.2.1511 MariaDB 版本 10.1.14
服务器运行正常,数据中心发生电源故障。当服务器恢复时,一切正常,但 MariaDB 无法启动。
我在 var/log 或 var/lib/mysql 中没有看到任何日志文件
journalctl -xe 返回,
Jul 07 17:54:16 localhost.localhost mysqld[7547]: This could be because you hit a bug. It is also possible that this binary
Jul 07 17:54:16 localhost.localhost mysqld[7547]: or one of the libraries it was linked against is corrupt, improperly built,
Jul 07 17:54:16 localhost.localhost mysqld[7547]: or misconfigured. This error can also be caused by malfunctioning hardware.
Jul 07 17:54:16 localhost.localhost mysqld[7547]: To report this bug, see https://mariadb.com/kb/en/reporting-bugs
Jul 07 17:54:16 localhost.localhost mysqld[7547]: We will try our best to scrape up some info that will hopefully help
Jul 07 17:54:16 localhost.localhost mysqld[7547]: diagnose the problem, but since we have already crashed,
Jul 07 17:54:16 localhost.localhost mysqld[7547]: something is definitely wrong and this may fail.
Jul 07 17:54:16 localhost.localhost mysqld[7547]: Server version: 10.1.14-MariaDB
Jul 07 17:54:16 localhost.localhost mysqld[7547]: key_buffer_size=33554432
Jul 07 17:54:16 localhost.localhost mysqld[7547]: read_buffer_size=131072
Jul 07 17:54:16 localhost.localhost mysqld[7547]: max_used_connections=0
Jul 07 17:54:16 localhost.localhost mysqld[7547]: max_threads=502
Jul 07 17:54:16 localhost.localhost mysqld[7547]: thread_count=0
Jul 07 17:54:16 localhost.localhost mysqld[7547]: It is possible that mysqld could use up to
Jul 07 17:54:16 localhost.localhost mysqld[7547]: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1135382 K bytes of memory
Jul 07 17:54:16 localhost.localhost mysqld[7547]: Hope that's ok; if not, decrease some variables in the equation.
Jul 07 17:54:16 localhost.localhost mysqld[7547]: Thread pointer: 0x0x0
Jul 07 17:54:16 localhost.localhost mysqld[7547]: Attempting backtrace. You can use the following information to find out
Jul 07 17:54:16 localhost.localhost mysqld[7547]: where mysqld died. If you see no messages after this, something went
Jul 07 17:54:16 localhost.localhost mysqld[7547]: terribly wrong...
Jul 07 17:54:16 localhost.localhost mysqld[7547]: stack_bottom = 0x0 thread_stack 0x48400
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] InnoDB: Waiting for purge to start
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7f6555c281be]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /usr/sbin/mysqld(handle_fatal_signal+0x38d)[0x7f6555753f0d]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /lib64/libpthread.so.0(+0xf100)[0x7f6554d72100]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /lib64/libc.so.6(gsignal+0x37)[0x7f65530cb5f7]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /lib64/libc.so.6(abort+0x148)[0x7f65530ccce8]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.29-76.2 started; log sequence number 394715515966
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] Plugin 'FEEDBACK' is disabled.
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] Recovering after a crash using tc.log
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140053758052096 [Note] InnoDB: Dumping buffer pool(s) not yet started
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] Starting crash recovery...
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] Crash recovery finished.
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] Server socket created on IP: '::'.
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /usr/sbin/mysqld(+0x37f0d7)[0x7f65555220d7]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [ERROR] Missing system table mysql.roles_mapping; please run mysql_upgrade to create it
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073195625216 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
Jul 07 17:54:16 localhost.localhost mysqld[7547]: 2016-07-07 17:54:16 140073196054656 [Note] /usr/sbin/mysqld: ready for connections.
Jul 07 17:54:16 localhost.localhost mysqld[7547]: Version: '10.1.14-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
Jul 07 17:54:16 localhost.localhost systemd[1]: Started MariaDB database server.
-- Subject: Unit mariadb.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has finished starting up.
--
-- The start-up result is done.
Jul 07 17:54:16 localhost.localhost polkitd[1099]: Unregistered Authentication Agent for unix-process:7532:158840 (system bus name :1.59, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /usr/sbin/mysqld(+0x8fea9b)[0x7f6555aa1a9b]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: mysys/stacktrace.c:247(my_print_stacktrace)[0x7f65559c03a9]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: include/fut0fut.ic:36(fut_get_ptr)[0x7f65559dc063]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: trx/trx0trx.cc:1230(trx_write_serialisation_history)[0x7f65559d275b]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: trx/trx0trx.cc:1674(trx_commit(trx_t*))[0x7f65559d3b70]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: trx/trx0roll.cc:1340(trx_rollback_finish)[0x7f65559ca7a8]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: trx/trx0roll.cc:828(trx_rollback_or_clean_all_recovered)[0x7f65559caeac]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /lib64/libpthread.so.0(+0x7dc5)[0x7f6554d6adc5]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: /lib64/libc.so.6(clone+0x6d)[0x7f655318cced]
Jul 07 17:54:16 localhost.localhost mysqld[7547]: The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
Jul 07 17:54:16 localhost.localhost mysqld[7547]: information that should help you find out what is causing the crash.
Jul 07 17:54:16 localhost.localhost systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Jul 07 17:54:16 localhost.localhost systemd[1]: Unit mariadb.service entered failed state.
Jul 07 17:54:16 localhost.localhost systemd[1]: mariadb.service failed.
lines 1243-1304/1304 (END)
答案1
添加
innodb_force_recovery = 3
到 my.cnf,现在已修复。我从 1 开始增加,现在已修复为 3。