我是 Linux 新手。我今天将 MariaDB 升级到版本 10.2.33,但服务拒绝启动:
mariadb.service - MariaDB 10.2.33 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: failed (Result: exit-code) since Wed 2020-09-09 17:21:29 IST; 36min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 4577 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --basedir=/usr $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 4546 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 4545 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 4577 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Sep 09 17:21:26 kinintapp01.server.ie systemd[1]: Starting MariaDB 10.2.33 database server...
Sep 09 17:21:26 kinintapp01.server.ie mysqld[4577]: 2020-09-09 17:21:26 140201819867328 [Note] /usr/sbin/mysqld (mysqld 10.2.33-MariaDB) starting as process 4577 ...
Sep 09 17:21:26 kinintapp01.server.ie mysqld[4577]: 2020-09-09 17:21:26 140201819867328 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32184)
Sep 09 17:21:29 kinintapp01.server.ie systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Sep 09 17:21:29 kinintapp01.server.ie systemd[1]: Failed to start MariaDB 10.2.33 database server.
Sep 09 17:21:29 kinintapp01.server.ie systemd[1]: Unit mariadb.service entered failed state.
Sep 09 17:21:29 kinintapp01.server.ie systemd[1]: mariadb.service failed.
检查错误日志:
2020-09-09 16:11:53 139670995248896 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2020-09-09 16:11:53 139670995248896 [Note] Event Scheduler: Purging the queue. 0 events
2020-09-09 16:11:53 139671036217088 [Note] InnoDB: FTS optimize thread exiting.
2020-09-09 16:11:53 139670995248896 [Note] InnoDB: Starting shutdown...
2020-09-09 16:11:53 139670918784768 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2020-09-09 16:11:53 139670918784768 [Note] InnoDB: Instance 0, restricted to 2047 pages due to innodb_buf_pool_dump_pct=25
2020-09-09 16:11:53 139670918784768 [Note] InnoDB: Buffer pool(s) dump completed at 200909 16:11:53
2020-09-09 16:11:54 139670995248896 [Note] InnoDB: Shutdown completed; log sequence number 3943889843
2020-09-09 16:11:54 139670995248896 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
200909 16:11:54 [ERROR] mysqld got signal 7 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 10.2.24-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=75
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467240 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x0 thread_stack 0x49000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x55c5caacc58e]
/usr/sbin/mysqld(handle_fatal_signal+0x30d)[0x55c5ca55821d]
:0(__ftrylockfile)[0x7f07dae405d0]
/usr/sbin/mysqld(_ZN11TC_LOG_MMAP5closeEv+0xfb)[0x55c5ca62d7db]
/usr/sbin/mysqld(+0x44a294)[0x55c5ca329294]
/usr/sbin/mysqld(_Z10unireg_endv+0x3b)[0x55c5ca32ae4b]
/usr/sbin/mysqld(+0x45072c)[0x55c5ca32f72c]
/usr/sbin/mysqld(kill_server_thread+0xe)[0x55c5ca32f7be]
:0(__nptl_deallocate_tsd)[0x7f07dae38dd5]
/lib64/libc.so.6(clone+0x6d)[0x7f07d91daead]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /var/lib/mysql
Resource Limits:
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 15681 15681 processes
Max open files 16364 16364 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 15681 15681 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Core pattern: core
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Uses event mutexes
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Using Linux native AIO
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Number of pools: 1
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Using SSE2 crc32 instructions
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Completed initialization of buffer pool
2020-09-09 16:11:54 139919955982080 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: Waiting for purge to start
2020-09-09 16:11:54 139920515954880 [Note] InnoDB: 5.7.31 started; log sequence number 3943889843
2020-09-09 16:11:54 139919791990528 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-09 16:11:54 139920515954880 [Note] Plugin 'FEEDBACK' is disabled.
2020-09-09 16:11:54 139920515954880 [Note] Recovering after a crash using tc.log
2020-09-09 16:11:54 139920515954880 [ERROR] Can't init tc log
2020-09-09 16:11:54 139920515954880 [ERROR] Aborting
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Uses event mutexes
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Using Linux native AIO
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Number of pools: 1
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Using SSE2 crc32 instructions
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Completed initialization of buffer pool
2020-09-09 17:21:26 140201259554560 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: The error means the system cannot find the path specified.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Cannot open datafile for read-only: './khtint/wp_posts.ibd' OS error: 71
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: The error means the system cannot find the path specified.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Could not find a valid tablespace file for `khtint/wp_posts`. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-09-09 17:21:26 140201819867328 [Warning] InnoDB: Ignoring tablespace for `khtint`.`wp_posts` because it could not be opened.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: 5.7.31 started; log sequence number 3943890087
2020-09-09 17:21:26 140200818767616 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-09 17:21:26 140200818767616 [Note] InnoDB: Buffer pool(s) load completed at 200909 17:21:26
2020-09-09 17:21:26 140201819867328 [Note] Plugin 'FEEDBACK' is disabled.
2020-09-09 17:21:26 140201819867328 [Note] Recovering after a crash using tc.log
2020-09-09 17:21:26 140201819867328 [ERROR] Can't init tc log
2020-09-09 17:21:26 140201819867328 [ERROR] Aborting
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Uses event mutexes
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Using Linux native AIO
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Number of pools: 1
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Using SSE2 crc32 instructions
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Completed initialization of buffer pool
2020-09-09 17:21:26 140201259554560 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: The error means the system cannot find the path specified.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Cannot open datafile for read-only: './khtint/wp_posts.ibd' OS error: 71
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: The error means the system cannot find the path specified.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Could not find a valid tablespace file for `khtint/wp_posts`. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-09-09 17:21:26 140201819867328 [Warning] InnoDB: Ignoring tablespace for `khtint`.`wp_posts` because it could not be opened.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: 5.7.31 started; log sequence number 3943890087
2020-09-09 17:21:26 140200818767616 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-09 17:21:26 140200818767616 [Note] InnoDB: Buffer pool(s) load completed at 200909 17:21:26
2020-09-09 17:21:26 140201819867328 [Note] Plugin 'FEEDBACK' is disabled.
2020-09-09 17:21:26 140201819867328 [Note] Recovering after a crash using tc.log
2020-09-09 17:21:26 140201819867328 [ERROR] Can't init tc log
2020-09-09 17:21:26 140201819867328 [ERROR] Aborting
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Uses event mutexes
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Using Linux native AIO
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Number of pools: 1
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Using SSE2 crc32 instructions
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Completed initialization of buffer pool
2020-09-09 17:21:26 140201259554560 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: The error means the system cannot find the path specified.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Cannot open datafile for read-only: './khtint/wp_posts.ibd' OS error: 71
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: The error means the system cannot find the path specified.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2020-09-09 17:21:26 140201819867328 [ERROR] InnoDB: Could not find a valid tablespace file for `khtint/wp_posts`. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-09-09 17:21:26 140201819867328 [Warning] InnoDB: Ignoring tablespace for `khtint`.`wp_posts` because it could not be opened.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-09 17:21:26 140201819867328 [Note] InnoDB: 5.7.31 started; log sequence number 3943890087
2020-09-09 17:21:26 140200818767616 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-09 17:21:26 140200818767616 [Note] InnoDB: Buffer pool(s) load completed at 200909 17:21:26
2020-09-09 17:21:26 140201819867328 [Note] Plugin 'FEEDBACK' is disabled.
2020-09-09 17:21:26 140201819867328 [Note] Recovering after a crash using tc.log
2020-09-09 17:21:26 140201819867328 [ERROR] Can't init tc log
2020-09-09 17:21:26 140201819867328 [ERROR] Aborting
我的 mysqld 选项如下:
--port=3306 --socket=/var/lib/mysql/mysql.sock --datadir=/var/lib/mysql --log-error=/var/log/mariadb/mariadb.log --max_allowed_packet=50M --innodb_log_file_size=100M
我在另一台服务器上执行了相同的升级,没有任何问题,但我不知道如何解决这个问题,因为似乎无法降级。如果能提供任何关于如何解决的建议,我将不胜感激。
答案1
通过将日志文件移动到备份解决了问题:
mv /var/lib/mysql/tc.log /var/lib/mysql/tc.log.bak