최근 테스트를 통과한 최신 버전으로 업그레이드하기 위해 리빌드를 실행하려고 할 때 아래 오류가 발생하고 있습니다. 이 작업에는 PostgreSQL 버전이 13에서 15로 상승하는 것도 포함됩니다.
[2025-03-12T20:49:22.045226 #1] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/15/main/pg_hba.conf
I, [2025-03-12T20:49:22.045431 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-03-12T20:49:22.045624 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-03-12T20:49:22.045816 #1] INFO -- : > if [ -f /root/install_postgres ]; then
/root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi
initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
W: https://dl.yarnpkg.com/debian/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
debconf: delaying package configuration, since apt-utils is not installed
cp: cannot stat '/etc/postgresql/13/main/*': No such file or directory
정말 오래된 OS와 Docker 버전을 사용하고 있다면, 재빌드를 다시 시도하기 전에 둘 다 업데이트하는 것을 권장합니다.
아마도 대형 데이터베이스를 업데이트 중이셨을 수 있습니다. 그렇다면 업데이트가 아직 실행 중일 수 있습니다. 재빌드 중에는 postgres_data와 postgres_data_new 디렉터리의 크기를 주기적으로 비교해 볼 수 있습니다. postgres_data_new의 크기가 계속 증가하고 있다면 업데이트가 아직 진행 중이라는 뜻입니다. (프로세스 목록에서 pg_upgrade 명령어가 실행 중인지도 확인할 수 있습니다.)
그 cp 오류는 당분간 무시하셔도 됩니다. 동일한 오류가 발생했지만 표준 설치 환경의 테스트 사이트는 업데이트에 성공했습니다. (이것은 상류(upstream) 변경 사항으로 인해 발생한 것이므로 이미지를 수정하여 오류를 제거할 예정이지만, 이전에 postgres 설정이 크게 수정되지 않았다면 데이터베이스 업데이트에 영향을 주지 않아야 합니다.)
네, 사이트를 복구할 수 있었습니다. 실제로 대용량 데이터베이스를 업데이트하고 있었지만, 위에서 언급한 디렉토리를 주시하여 postgres_data_new가 계속 증가하는지 확인하고 있었습니다. 그러나 시간이 지나도 더 이상 크기가 증가하지 않았고, 스크립트는 해당 명령어에서 멈춰 버렸습니다.
설정 자체는 db의 크기가 큰 점을 제외하면 상당히 표준적인 것이었습니다. 세부 사항을 정리하여 오늘 안에 공유하겠습니다.