최신 버전 업그레이드 문제

Discourse를 최신 버전으로 업데이트하려고 하고 있습니다.

FAILED
--------------------
Pups::ExecError: /root/upgrade_postgres failed with return #<Process::Status: pid 45 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "/root/upgrade_postgres"
1cafe54cd6661316d8e9e393c54f73ab89bc3f5e70e104f6c5e4f8794053c09c
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

또한

 Success. You can now start the database server using:

    pg_ctlcluster 10 main start

Warning: The selected stats_temp_directory /var/run/postgresql/10-main.pg_stat_tmp
is not writable for the cluster owner. Not adding this setting in
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: warning: forcing reinstallation of alternative /usr/share/postgresql/12/man/man1/postmaster.1.gz because link group postmaster.1.gz is broken
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for postgresql-common (213.pgdg100+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Stopping PostgreSQL 10 database server: main.
Stopping PostgreSQL 12 database server: main.
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok

The source cluster was not shut down cleanly.
Failure, exiting

tail -f shared/standalone/log/var-log/postgres/current 명령의 출력:

2020-06-14 01:37:02.155 UTC [3508] FATAL:  data directory "/shared/postgres_data" has wrong ownership
2020-06-14 01:37:02.155 UTC [3508] HINT:  The server must be started by the user that owns the data directory.

업데이트 보류

다음 재빌드 시 업데이트를 보류해야 하는 경우, app.yml 파일의 PostgreSQL 템플릿을 "templates/postgres.template.yml"에서 "templates/postgres.10.template.yml"로 변경하여 교체할 수 있습니다.

일부 사이트 관리자가 나중에 이 변경 사항을 되돌리는 것을 잊을 수 있으므로 권장되지 않습니다.

이 방법을 적용했고 이제 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

업그레이드 완료
----------------
pg_upgrade는 옵티마이저 통계 정보를 이전하지 않으므로,
새 서버를 시작하면 다음을 실행하는 것을 고려해 보세요:
    ./analyze_new_cluster.sh

이 스크립트를 실행하면 이전 클러스터의 데이터 파일이 삭제됩니다:
    ./delete_old_cluster.sh
-------------------------------------------------------------------------------------
POSTGRES 업그레이드 완료

이전 10 데이터베이스는 /shared/postgres_data_old에 저장되어 있습니다

업그레이드를 완료하려면 다음을 사용하여 다시 빌드하세요:

./launcher rebuild app

현재 Discourse 포럼은 오프라인 상태입니다.

위에서 안내한 대로 ./launcher rebuild app을 다시 실행해 보고 있습니다.

네, 예상되는 상황입니다.

네, 설명에 따라 진행하시면 곧 복구될 것입니다.

흥미롭고 멋진 결과네요. 이제 업데이트가 성공적으로 완료되었습니다. 이전에도 같은 방식으로 여러 번 시도해 봤지만, 이런 결과는 처음입니다.

공간을 정리하려면 다음 명령어를 사용해야 하나요?

Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
    ./analyze_new_cluster.sh

Running this script will delete the old cluster's data files:
    ./delete_old_cluster.sh

감사합니다!

자주 묻는 질문(FAQ)에 나열된 업데이트 후 선택적 작업 실행을 수행할 수 있습니다.

훌륭합니다. 다시 한번 감사합니다!