升级最新版本时遇到问题

你好,我试图将 Discourse 更新到最新版本。

FAILED
--------------------
Pups::ExecError: /root/upgrade_postgres 执行失败,返回状态为 #<Process::Status: pid 45 exit 1>
失败位置:/pups/lib/pups/exec_command.rb:112:in `spawn'
执行失败,参数为 "/root/upgrade_postgres"
1cafe54cd6661316d8e9e393c54f73ab89bc3f5e70e104f6c5e4f8794053c09c
** 启动失败 ** 请向上滚动查看之前的错误信息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。

另外:

 成功。现在可以使用以下命令启动数据库服务器:

    pg_ctlcluster 10 main start

警告:选定的 stats_temp_directory /var/run/postgresql/10-main.pg_stat_tmp
对集群所有者不可写。因此未将其添加到
postgresql.conf 中。
Ver Cluster Port Status Owner    Data directory              Log file
10  main    5433 down   postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
update-alternatives: 警告:由于链接组 postmaster.1.gz 已损坏,强制重新安装替代项 /usr/share/postgresql/12/man/man1/postmaster.1.gz
invoke-rc.d: 无法确定当前运行级别
invoke-rc.d: policy-rc.d 拒绝了启动操作。
正在处理 postgresql-common (213.pgdg100+1) 的触发器...
从已安装的 myspell/hunspell 包构建 PostgreSQL 词典...
删除过时的词典文件:
正在停止 PostgreSQL 10 数据库服务器:main。
正在停止 PostgreSQL 12 数据库服务器:main。
执行一致性检查
-----------------------------
检查集群版本                                   正常

源集群未正常关闭。
失败,正在退出

tail -f shared/standalone/log/var-log/postgres/current 命令的输出:

2020-06-14 01:37:02.155 UTC [3508] FATAL: 数据目录 "/shared/postgres_data" 的权限归属错误
2020-06-14 01:37:02.155 UTC [3508] HINT: 服务器必须由拥有数据目录的用户启动。

推迟更新

如果您需要在下次重建时推迟更新,可以在 app.yml 文件中将 "templates/postgres.template.yml" 更改为 "templates/postgres.10.template.yml",以替换 PostgreSQL 模板。

不建议这样做,因为一些站点管理员可能会忘记在之后恢复此更改。

我已应用此更改,Discourse 论坛现已在线。接下来我们该怎么做? 目前,我使用的是 “templates/postgres.10.template.yml”。

有什么建议吗?我仍然在使用“templates/postgres.10.template.yml”。

请尝试以下步骤:

  1. 编辑 app.yml,将 "templates/postgres.10.template.yml" 更改为 "templates/postgres.template.yml"

  2. 执行停止操作:./launcher stop app

  3. 尝试重新构建:./launcher rebuild app

2 个赞

升级完成

pg_upgrade 不会转移优化器统计信息,因此,
在启动新服务器后,请考虑运行:
./analyze_new_cluster.sh

运行此脚本将删除旧集群的数据文件:
./delete_old_cluster.sh

PostgreSQL 升级完成

旧版 10 数据库存储在 /shared/postgres_data_old

要完成升级,请再次使用以下命令重建:

./launcher rebuild app

Discourse 论坛目前处于离线状态。

我正在按照上述说明再次运行 ./launcher rebuild app。

是的,这是预期的情况。

是的,请按照说明操作,论坛应该很快就能恢复。

1 个赞

有趣又棒,现在更新已成功完成。我之前多次尝试过同样的方法,但从未成功过。

我需要使用以下命令来清理空间吗?

pg_upgrade 不会转移优化器统计信息,因此,
在启动新服务器后,建议运行:
    ./analyze_new_cluster.sh

运行此脚本将删除旧集群的数据文件:
    ./delete_old_cluster.sh

谢谢!

您可以运行我们常见问题解答中列出的帖子更新可选任务

1 个赞

太好了,再次感谢!

1 个赞

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