A stop job is running for MariaDB database service(Waiting for page_cleaner) 原因及解決方法。

在關機或重啟的時候發現:

A stop job is running for MariaDB database service.

居然需要耗時幾十分鐘,強制關機重啟後,利用以下命令檢查日誌:

1$ journalctl -u mariadb.service
2Feb 25 14:37:57 archlinux mysqld[580]: 2020-02-25 14:37:57 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
3Feb 25 14:38:57 archlinux mysqld[580]: 2020-02-25 14:38:57 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
4Feb 25 14:39:57 archlinux mysqld[580]: 2020-02-25 14:39:57 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
5Feb 25 14:40:58 archlinux mysqld[580]: 2020-02-25 14:40:58 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
6...

解決#

經過一番搜索,可以通過以下命令解決:

1$ timedatectl set-local-rtc 0

相關鏈接:#

How to fix MariaDB when it gets stuck during shutdown (Waiting for page_cleaner)?