Docker 升级移除 AUFS 存储驱动,导致 Discourse 无法运行

我运行着一个 Discourse 论坛,安装在 Ubuntu 20.04.6 LTS 上。Docker 镜像使用 AUFS 进行存储。

今天,我通过 sudo apt upgrade 安装了升级。现在 Discourse 论坛无法访问,原因似乎是 Docker 升级移除了 AUFS 存储驱动。

我看到了很多关于配置 Docker 使用 Overlay2 的指南,但没有找到关于如何迁移现有 Discourse 安装以使用 Overlay2 的指导,尤其是在我无法启动 Docker 来挂载 AUFS 卷的情况下。

当我执行

sudo dockerd --debug

输出是

INFO[2024-05-15T19:49:04.327570182-04:00] Starting up
DEBU[2024-05-15T19:49:04.332295421-04:00] Listener created for HTTP on unix (/var/run/docker.sock)
WARN[2024-05-15T19:49:04.340758649-04:00] failed to rename /var/lib/docker/tmp for background deletion: rename /var/lib/docker/tmp /var/lib/docker/tmp-old: file exists. Deleting synchronously
DEBU[2024-05-15T19:49:04.427688615-04:00] Golang's threads limit set to 13680
DEBU[2024-05-15T19:49:04.430903802-04:00] metrics API listening on /var/run/docker/metrics.sock
DEBU[2024-05-15T19:49:04.554881397-04:00] Using default logging driver json-file
DEBU[2024-05-15T19:49:04.555543790-04:00] No quota support for local volumes in /var/lib/docker/volumes: Filesystem does not support, or has not enabled quotas
DEBU[2024-05-15T19:49:04.563660483-04:00] processing event stream                       module=libcontainerd namespace=plugins.moby
DEBU[2024-05-15T19:49:04.567109514-04:00] Error while looking up volume                 driver=local error="volume not found" volume=
DEBU[2024-05-15T19:49:04.567813165-04:00] Error while looking up volume                 driver=local error="volume not found" volume=
INFO[2024-05-15T19:49:04.574217050-04:00] [graphdriver] trying configured driver: aufs
DEBU[2024-05-15T19:49:04.574500003-04:00] daemon configured with a 15 seconds minimum shutdown timeout
DEBU[2024-05-15T19:49:04.574603992-04:00] start clean shutdown of all containers with a 15 seconds timeout...
DEBU[2024-05-15T19:49:04.578694693-04:00] Cleaning up old mountid : start.
DEBU[2024-05-15T19:49:04.579329989-04:00] Cleaning up old mountid : done.
failed to start daemon: error initializing graphdriver: [graphdriver] ERROR: the aufs storage-driver has been deprecated and removed; visit https://docs.docker.com/go/storage-driver/ for more information: aufs

如何才能在不丢失任何数据的情况下恢复我的 Discourse 论坛?我能否以某种方式恢复 AUFS 存储驱动,然后迁移到 Overlay2 存储?

您不会丢失数据,它在 /var/discourse/shared 中。

如果 Docker 工作正常,只需重建即可。

抱歉,Docker 在升级后停止工作了。您可以在我提供的输出的最后一行看到错误。

如果我将 /etc/docker/daemon.json 的内容从

 {
     "storage-driver": "aufs"
 }

更改为

 {
     "storage-driver": "overlay2"
 }

就可以启动 Docker。

但是,在我进行此更改后,我的 Discourse 论坛仍然无法正常工作。

您的意思是,如果我执行以下操作并重启 Docker,它就能正常工作,并保留用户、帖子、其他配置和历史数据吗?

cd /var/discourse
git pull
./launcher rebuild app

以这种方式重建 Discourse 会将所有论坛数据迁移到 Overlay2 存储吗?

我认为那会奏效。我无法想象会丢失数据。

1 个赞

您说得对,看来是这样。在 /etc/docker/daemon.json 中将存储驱动程序更改为 overlay2 并执行 ./launcher rebuild app 后,论坛似乎已恢复正常运行。

现在我想知道是否应该冒险将 Ubuntu 版本升级到 22.04.3 LTS:slight_smile:

我建议再等一段时间,创建一个新的 24.04 镜像并迁移到它,而不是进行升级,或者干脆现在就迁移到 22.04。我不信任升级过程中有多少东西没有被正确升级。此外,你可以避免停机时间,如果出现任何问题,你的旧服务器仍然可以正常工作。

使用 rsync 将 Discourse 站点迁移到另一个 VPS

2 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.