본문 바로가기
DB 인사이드 | PostgreSQL Replication - Slot Replication Slot 탄생PostgreSQL에서 안정적인 Replication 유지를 위한 WAL 파일의 관리는 항상 어려운 문제였습니다. Standby Server의 연결이 끊어진 상태에서 Main Server의 WAL 파일이 재사용(Overwrite) 되면 Replication 상태를 유지할 수 없으므로 다음과 같은 에러를 마주하게 됩니다.LOG: started streaming WAL from primary at 0/3000000 on timeline 1FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000000000000003 has already been removed그리고 이러.. 2023. 7. 26.
DB 인사이드 | PostgreSQL Replication - Function 이번 문서에서는 PostgreSQL Replication과 관련된 Function에 대해 알아보겠습니다. Function ListWAL 관련 Functionpg_current_wal_lsnpg_current_wal_flush_lsnpg_current_wal_insert_lsnpg_walfile_namepg_walfile_name_offsetpg_switch_walpg_wal_lsn_diff  Standby Server 관련 Functionpg_is_in_recoverypg_last_wal_receive_lsnpg_last_wal_replay_lsnpg_last_xact_replay_timestamppg_get_wal_replay_pause_statepg_is_wal_replay_pausedpg_wal_r.. 2023. 6. 29.
DB 인사이드 | PostgreSQL Replication - Trouble Shooting 📢 본 문서는 PostgreSQL Replication 설정 시 발생할 수 있는 내용을 다룹니다. PostgreSQL Replication 구성에 대한 내용은 PostgreSQL Replication - 구성을 참조하세요.1. ssh-keygen 설정 2. listen_addresses 설정하지 않았을 경우3. pg_hba.conf 설정하지 않았을 경우 4. max_wal_senders를 1 이하로 설정했을 경우 5. hot_standby 설정 6. Replication User 접속 불가 7. PostgreSQL Database Encoding/locale 옵션이 다른 경우 8. recovery.conf 9. postgresql.conf 위치 확인 10. pg_hba.conf 위치 확인 11. Onl.. 2023. 5. 25.
DB 인사이드 | PostgreSQL Replication - 구성 시작하며본 문서에서는 앞서 설명한 다양한 Replication 방식의 설정에 대해 알아보도록 하겠습니다.이 중 가장 많이 언급되는 Log Shipping, Streaming, Logical Replication방식으로 환경 구성을 진행하며, 그 과정에서 직접적인 연관이 없거나 발생 가능한 이슈에 대해서는 별도 문서인 PostgreSQL Replication - Trouble Shooting을 통해 다루도록 하겠습니다.구성을 위한 환경은 다음과 같으며, Replication Slot 관련 설정은 포함되지 않습니다.CaseReplication 방법Main Server (10.10.45.230)Standby Server (10.10.45.231)1Log ShippingCentOS 7.9 / PostgreSQL.. 2023. 5. 25.
DB 인사이드 | PostgreSQL Replication - 종류 Replication은 Data 저장과 백업하는 방법과 관련이 있는 Data를 호스트 컴퓨터에서 다른 컴퓨터로 복사하는 것을 말한다. Replication은 RDBMS에서 추가적으로 제공하거나 여러 대의 Database Server의 부하를 맞추어 줄 용도로 제공한다. Database Replication에서 사용되는 것은 대부분 Database 관리 영역인데 보통 Master/Slave 관계를 갖는 원본과 복사본 사이를 다룬다.— 위키백과 (Replication)Database ReplicationDatabase를 Replication(복제)하는 이유는 크게 Database의 부하분산(Load Balancing), 고가용성(High Availability), 백업등으로 나눌 수 있습니다.Main Dat.. 2023. 4. 27.