从 10.11.4 升级后 MariaDB 11.0.2 无法启动

从 10.11.4 升级后 MariaDB 11.0.2 无法启动

我在使用 Debian Bullseye,刚刚将 MariaDB 从 10.11.4 升级(或至少尝试升级)到 11.0.2。

不幸的是,该服务现在无法启动。我得到的所有信息systemctl status mariadb.servicejournalctl -xe毫无帮助,例如(分别):

● mariadb.service - MariaDB 11.0.2 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: inactive (dead) (Result: signal) since Fri 2023-06-16 22:05:13 CEST; 4s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 6291 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCE>
    Process: 6292 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCC>
    Process: 6294 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/>
    Process: 6323 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, si>
   Main PID: 6323 (code=killed, signal=ABRT)
        CPU: 144ms
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max processes             128262               128262               processes
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max open files            32768                32768                files
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max locked memory         524288               524288               bytes
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max address space         unlimited            unlimited            bytes
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max file locks            unlimited            unlimited            locks
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max pending signals       128262               128262               signals
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max msgqueue size         819200               819200               bytes
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max nice priority         0                    0
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max realtime priority     0                    0
Jun 16 22:05:10 XXXXX mariadbd[6323]: Max realtime timeout      unlimited            unlimited            us
Jun 16 22:05:10 XXXXX mariadbd[6323]: Core pattern: core
Jun 16 22:05:10 XXXXX mariadbd[6323]: Kernel version: Linux version 5.10.0-23-amd64 ([email protected]) >
Jun 16 22:05:10 XXXXX systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ An ExecStart= process belonging to unit mariadb.service has exited.
░░
░░ The process' exit code is 'killed' and its exit status is 6.
Jun 16 22:05:10 XXXXX systemd[1]: mariadb.service: Failed with result 'signal'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit mariadb.service has entered the 'failed' state with result 'signal'.
Jun 16 22:05:10 XXXXX systemd[1]: Failed to start MariaDB 11.0.2 database server.
░░ Subject: A start job for unit mariadb.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit mariadb.service has finished with a failure.
░░
░░ The job identifier is 6703 and the job result is failed.

我将尝试通过错误日志进一步调试这个问题,不幸的是,尽管我设置log_error=/var/log/mysql/error.log并追踪了所有实例,但 MariaDB 仍然拒绝记录错误,skip_log_error而且syslog这些实例似乎是在 Debian 配置文件中预先配置的。

现在,如果我重命名/var/lib/mysql并重新初始化它,服务就可以正常工作。然而,这对我来说不是一个解决方案,因为我需要恢复数据和当然这次我没有备份。

有什么想法或潜在的解决方案吗?

答案1

对于所有未来的用户来说,这并非一个完美的答案,但我设法通过首先降级到全新安装(备份以前的数据目录)然后逐个复制数据目录中的数据库和其他文件来恢复所有数据。有趣的是,当以这种方式进行时,这也导致了向前兼容性。我认为问题是,如果我必须同时在所有数据库上执行升级脚本,升级脚本就会失败——我有几个大数据库,分别约为 50GB 和 25GB,这些可能阻碍了升级。

相关内容