DBAtlas · 데이터베이스 운영 아틀라스

pgBackRest stanza 생성 및 아카이브 검증(stanza-create/check)

PostgreSQL백업 및 PITR

명령어

# Create the stanza in the repository (once):
sudo -u postgres pgbackrest --stanza=<stanza> --log-level-console=info stanza-create
# Verify configuration and archiving end to end (switches WAL and waits for the segment to reach the repo):
sudo -u postgres pgbackrest --stanza=<stanza> --log-level-console=info check

하는 일

stanza-create는 저장소에 클러스터 메타데이터(system identifier, 버전)를 생성한다. check는 실제 WAL switch로 PostgreSQL 연결, archive_command, 저장소로의 WAL 도착을 테스트한다.

사용 시점

초기 구성 시, archive_command나 저장소 변경 후, 모니터링/cron 상태 점검으로.

주의

명령은 postgres(또는 저장소 소유자)로 실행한다. root로 실행하면 파일 소유권이 깨진다. 메이저 버전 업그레이드 후에는 stanza-create가 아니라 stanza-upgrade가 필요하다. check가 실패하면 백업이 완료되더라도 PITR이 불가능할 수 있다.

DBAtlas에서 열기 →

관련 항목