--提前致歉。我不是一个程序员,但在论坛上得到很多热心人士的帮助后,我才走到今天这一步--
我在 GCP 上运行了一个 VM 实例,几年来一直没有出现问题。刚刚收到来自 Google Search Console 的非技术服务器错误消息 (5xx)
重新启动虚拟机 - 但现在消息返回“无法连接到 MySQL:(2002)没有这样的文件或目录错误:”
Ransudo systemctl start mariadb
回复如下:
mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-03-23 15:16:45 UTC; 19s ago
Process: 1258 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 1169 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_P
OSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 1166 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 1163 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 1258 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Mar 23 15:16:45 jinguru-lamp-004 systemd[1]: Starting MariaDB database server...
Mar 23 15:16:45 jinguru-lamp-004 mysqld[1258]: 2022-03-23 15:16:45 139952113873472 [Note] /usr/sbin/mysqld (mysqld 10.1.26-MariaDB-0+deb9u1) starting as process 1258 ...
Mar 23 15:16:45 jinguru-lamp-004 mysqld[1258]: 2022-03-23 15:16:45 139952113873472 [Warning] Can't create test file /var/lib/mysql/jinguru-lamp-004.lower-test
Mar 23 15:16:45 jinguru-lamp-004 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Mar 23 15:16:45 jinguru-lamp-004 systemd[1]: Failed to start MariaDB database server.
Mar 23 15:16:45 jinguru-lamp-004 systemd[1]: mariadb.service: Unit entered failed state.
Mar 23 15:16:45 jinguru-lamp-004 systemd[1]: mariadb.service: Failed with result 'exit-code'.
扫描了网上的资源,发现如下问题:
tc.log(尝试删除/重命名 - 文件上没有任何内容)ntp.drift(不完全确定如何管理这个)
运行 journalctl - 突出显示的行是:
Mar 23 15:11:57 localhost kernel: [Firmware Bug]: TSC doesn't count with P0 frequency!
Mar 23 15:11:57 localhost kernel: piix4_smbus 0000:00:01.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
Mar 23 15:12:00 jinguru-lamp-004 ntpd[685]: format error frequency file /var/lib/ntp/ntp.drift
Mar 23 15:12:00 jinguru-lamp-004 ntpd[685]: bind(21) AF_INET6 fe80::4001:aff:fe80:4%2#123 flags 0x11 failed: Cannot assign requested address
Mar 23 15:12:00 jinguru-lamp-004 ntpd[685]: unable to create socket on eth0 (5) for fe80::4001:aff:fe80:4%2#123
Mar 23 15:12:02 jinguru-lamp-004 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Mar 23 15:12:02 jinguru-lamp-004 systemd[1]: Failed to start MariaDB database server.
Mar 23 15:12:02 jinguru-lamp-004 systemd[1]: mariadb.service: Unit entered failed state.
Mar 23 15:12:02 jinguru-lamp-004 systemd[1]: mariadb.service: Failed with result 'exit-code'.
看过问答 https://serverfault.com/questions/1045343/cant-start-mariadb-anymore-on-debian-10
但这似乎并不能解决问题:service mysql restart 产生:
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.