database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 10227 게시물 읽기
No. 10227
백업 관련 문의 드립니다.
작성자
허원석(jigsawfit)
작성일
2021-01-23 13:32
조회수
1,629

안녕하세요.


운영 중인 DB 를 모니터링하다 11월 16일에 수행한 풀 백업 스크립트의 pg_stop_backup 이 제대로 수행되지 않고 있던게 확인되어 로그를 보니 아래와 같았고,

/xlog/archive_status 에는 .ready 파일이 엄청 많이 쌓여있었습니다. (0000000100018A7300000056.ready 부터 였습니다.)


wal 파일이 과다생성되면서 max_wal_size 값에 따라 체크포인트가 일어났고, 0000000100018A7300000056 을 아카이빙 하기 전에

덮어써서 파일을 찾을 수 없었던걸까요..?


혹시 archive_command 를 이용해 해당 사항을 피하거나 아니면 max_wal_size 와 min_wal_size 를 50GB 정도로 높이면 해결할 수 있을까요?


관련 파라미터는 아래와 같습니다.


checkpoint_timeout = 20min

checkpoint_completion_target = 0.9


max_wal_size = 2GB

min_wal_size = 2GB


(xlog가 저장되는 파일 시스템 사이즈는 250GB 입니다.)


#archive_timeout = 0

archive_mode = on

archive_command = 'dd conv=fdatasync bs=256k if=%p of=/arch/%f && \mv -vf /arch/%f /arch/db'




dd: opening `xlog/0000000100018A7300000056': No such file or directory

2021-01-16 00:00:19 KST @/ (11201) LOG:  archive command failed with exit code 1

2021-01-16 00:00:19 KST @/ (11201) DETAIL:  The failed archive command was: dd conv=fdatasync bs=256k if=xlog/0000000100018A7300000056 of=/arch/0000000100018A7300000056 && \mv -vf /arch/0000000100018A7300000056 /arch/db

dd: opening `xlog/0000000100018A7300000056': No such file or directory

2021-01-16 00:00:20 KST @/ (11201) LOG:  archive command failed with exit code 1

2021-01-16 00:00:20 KST @/ (11201) DETAIL:  The failed archive command was: dd conv=fdatasync bs=256k if=xlog/0000000100018A7300000056 of=/arch/0000000100018A7300000056 && \mv -vf /arch/0000000100018A7300000056 /arch/db

dd: opening `xlog/0000000100018A7300000056': No such file or directory

2021-01-16 00:00:21 KST @/ (11201) LOG:  archive command failed with exit code 1

2021-01-16 00:00:21 KST @/ (11201) DETAIL:  The failed archive command was: dd conv=fdatasync bs=256k if=xlog/0000000100018A7300000056 of=/arch/0000000100018A7300000056 && \mv -vf /arch/0000000100018A7300000056 /arch/db

2021-01-16 00:00:21 KST @/ (11201) WARNING:  archiving transaction log file "0000000100018A7300000056" failed too many times, will try again later

...

...

2021-01-16 11:17:07 KST postgres@[local]/postgres (8468) WARNING:  pg_stop_backup still waiting for all required WAL segments to be archived (60 seconds elapsed)

2021-01-16 11:17:07 KST postgres@[local]/postgres (8468) HINT:  Check that your archive_command is executing properly.  pg_stop_backup can be canceled safely, but the database backup will not be usable without all the WAL segments.

dd: opening `xlog/0000000100018A7300000056': No such file or directory

2021-01-16 11:17:12 KST @/ (11201) LOG:  archive command failed with exit code 1

2021-01-16 11:17:12 KST @/ (11201) DETAIL:  The failed archive command was: dd conv=fdatasync bs=256k if=xlog/0000000100018A7300000056 of=/arch/0000000100018A7300000056 && \mv -vf /arch/0000000100018A7300000056 /arch/db

dd: opening `xlog/0000000100018A7300000056': No such file or directory

2021-01-16 11:17:13 KST @/ (11201) LOG:  archive command failed with exit code 1

2021-01-16 11:17:13 KST @/ (11201) DETAIL:  The failed archive command was: dd conv=fdatasync bs=256k if=xlog/0000000100018A7300000056 of=/arch/0000000100018A7300000056 && \mv -vf /arch/0000000100018A7300000056 /arch/db

dd: opening `xlog/0000000100018A7300000056': No such file or directory

2021-01-16 11:17:14 KST @/ (11201) LOG:  archive command failed with exit code 1

2021-01-16 11:17:14 KST @/ (11201) DETAIL:  The failed archive command was: dd conv=fdatasync bs=256k if=xlog/0000000100018A7300000056 of=/arch/0000000100018A7300000056 && \mv -vf /arch/0000000100018A7300000056 /arch/db

2021-01-16 11:17:14 KST @/ (11201) WARNING:  archiving transaction log file "0000000100018A7300000056" failed too many times, will try again later

2021-01-16 11:18:07 KST postgres@[local]/postgres (8468) WARNING:  pg_stop_backup still waiting for all required WAL segments to be archived (120 seconds elapsed)

2021-01-16 11:18:07 KST postgres@[local]/postgres (8468) HINT:  Check that your archive_command is executing properly.  pg_stop_backup can be canceled safely, but the database backup will not be usable without all the WAL segments.

dd: opening `xlog/0000000100018A7300000056': No such file or directory

2021-01-16 11:18:14 KST @/ (11201) LOG:  archive command failed with exit code 1

2021-01-16 11:18:14 KST @/ (11201) DETAIL:  The failed archive command was: dd conv=fdatasync bs=256k if=xlog/0000000100018A7300000056 of=/arch/0000000100018A7300000056 && \mv -vf /arch/0000000100018A7300000056 /arch/db

이 글에 대한 댓글이 총 2건 있습니다.

1.  archive_command = 'true'

2. pg_ctl reload

3. touch xlog/0000000100018A7300000056

(이하 archive_status 디렉터리안에 ready 파일은 있는데, xlog에는 없는 파일들은 모두 touch 로 빈파일을 만들어야할 것입니다.)

4. ready 파일이 모두 done 파일로 바뀌기를, xlog 디렉터리안 파일들이 모두 정리 되기를 기다리기

5. archive_command = ' 원래로'

6. pg_ctl reload

7. base backup 부터 다시.


빨리 진행하셔야할 것 같습니다. (이제 봐서 이미 작업했을 것이라 믿지만)

그냥 내버려두면, xlog 쪽 여유 공간이 없어 데이터베이스 서버가 중지될 수 있습니다.

김상기(ioseph)님이 2021-01-25 14:00에 작성한 댓글입니다.

답변 감사드립니다.

허원석(jigsawfit)님이 2021-01-25 18:18에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
10231postgresDB 에서 drop table 시 disk 공간에 변경이 없나요? [1]
나종현
2021-02-15
1470
10229pg 커널파라미터 설정값 [1]
궁금
2021-01-29
1525
10228Oracle to Postgresql Migration 전 성능 비교 문의 드립니다. [3]
김동욱
2021-01-26
1783
10227백업 관련 문의 드립니다. [2]
허원석
2021-01-23
1629
10226CPU 사용량 100% 원인 파악이 안됩니다. 가르침을 청합니다. ㅜㅜ [3]
허재식
2021-01-11
1964
10225쿼리 및 커서 캐싱 [2]
charlie p
2021-01-07
1415
10224성능지연관련 인덱스 생성여부 문의(epas 10버전) [2]
우재권
2021-01-07
1387
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.049초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다