【发布时间】:2021-11-24 04:54:39
【问题描述】:
我已经将 Portainer 下载到我的服务器上,并在那里的容器中创建了一个 PostgreSQL 数据库。 今天我无法再访问数据库。日志显示存在版本问题的消息。
我已经阅读过一些类似的问题,例如 Postgres container crashes with `database files are incompatible with server` after container's image has been updated to the latest one 和 Postgres container crashes with `database files are incompatible with server` after container's image has been updated to the latest one
解决方案brew postgresql-upgrade-database 不起作用。
我能做什么?
日志
2021-10-03 [1] FATAL: database files are incompatible with server
2021-10-03 [1] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.0 (Debian 14.0-1.pgdg110+1).
PostgreSQL Database directory appears to contain a database; Skipping initialization
我也发现了这个https://www.postgresql.org/docs/14/upgrading.html,但命令不起作用。我是否需要以某种方式在容器中执行此操作,或者哪些命令可以使其在容器中运行?
【问题讨论】:
-
您是否也有类似瞭望塔之类的东西可以将容器更新到最新版本?我会使用
postgres:13图像(如果您从 docker.io 获取 postgres)保持在版本 13。 -
我不认为我有其中之一。你能告诉我我该怎么做吗?
-
您需要将数据库升级到 v14。请阅读文档。
标签: postgresql docker debian portainer