나는 분산 postgres 데이터베이스 시스템을 설정하고 hot_standby wal_level을 사용하여 복제를 구성했습니다.분배 된 postgres depolyment가 동기화되지 않음
읽기 전용 인스턴스로 사용되는 여러 복제본 (현재 전 세계 15 개)이있는 중앙 마스터 데이터베이스가 하나 있습니다. 따라서 장애 조치가 필요하지 않습니다. 우리는 데이터를 우리가 할 수있는 원격 위치에 동기화하기를 원합니다. 그들을 읽으십시오.
마스터 :
wal_level = hot_standby
max_wal_senders = 20
checkpoint_segments = 8
wal_keep_segments = 8
클라이언트 : 클라이언트 측
가wal_level = hot_standby
max_wal_senders = 3
checkpoint_segments = 8
wal_keep_segments = 8
hot_standby = on
/var/lib/postgresql/9.4/recovery.conf :
standby_mode = 'on'
primary_conninfo = 'host=<IP of master> port=5432 user=replicator password=xxxx sslmode=require'
trigger_file = '/tmp/postgresql.trigger'
복제가 시작 - 모든 며칠 동안 괜찮아 보인다. 이 복제에 대한 마스터에서 접수 더 이상 연결이 보인다 며칠 후 ...
클라이언트 :
2017-05-04 01:16:51 UTC [9608-1] FATAL: could not connect to the primary server: FATAL: sorry, too many clients already
2017-05-04 01:16:57 UTC [10807-1] FATAL: could not connect to the primary server: FATAL: sorry, too many clients already
2017-05-04 01:17:02 UTC [12022-1] FATAL: could not connect to the primary server: FATAL: sorry, too many clients already
2017-05-04 01:17:06 UTC [13217-1] FATAL: could not connect to the primary server: FATAL: remaining connection slots are reserved for non-replication superuser connections
...
마스터 :
다음 loag는 다음과 같은 메시지로 가득하다 - 그것은 결코 ... 복구하지
2017-05-04 08:44:14 UTC [24850-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:19 UTC [25958-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:24 UTC [27063-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:29 UTC [28144-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:34 UTC [29227-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:39 UTC [30316-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
...
클라이언트 :
,2017-04-30 11:26:22 UTC [28474-1] LOG: started streaming WAL from primary at 35/14000000 on timeline 1
2017-04-30 11:26:22 UTC [28474-2] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-04-30 11:26:26 UTC [29328-1] LOG: started streaming WAL from primary at 35/14000000 on timeline 1
2017-04-30 11:26:26 UTC [29328-2] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-04-30 11:26:31 UTC [30394-1] LOG: started streaming WAL from primary at 35/14000000 on timeline 1
2017-04-30 11:26:31 UTC [30394-2] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000003500000014 has already been removed
...
그래서 내 질문 :
- 는 원격 읽기 전용하는 경우 변경 내용을 동기화하거나 난 그냥 몇 시간 후 내 복제 휴식을 만드는 CONFIGS에 오류가 말고, 더 좋은 방법은 무엇입니까?
너의 도움을 많이!
WAL을 저장하기 위해 archive_command (recovery.conf에서)를 사용하지 않고 실제로 '000000010000003500000014'가 없으면 복제를 다시 작성해야합니다. –
로그 샘플 또는 config ... –
아래 내용은 무엇을 의미합니까? WAL을 저장하기 위해 archive_command (recovery.conf에서)를 사용하지 않고 000000010000003500000014가 아닌 경우 – roegi