Olá,

Configurei uma replicação usando apenas log-shipping, via WAN, mas o standby
está tendo problemas para consumir os WAL files gerados pelo master. Segue
cenário:

[MASTER]
SO: Slackware 13 x86_64
PG: 9.1.1 compilado a partir do fonte

[SLAVE]
SO: Ubuntu Server 11.10 x86_64
PG: 9.1.1 compilado a partir do fonte

Executei a seguinte sequencia de passos:

1) Configurei o archive no master e replication no master
#WRITE AHEAD LOG
wal_level = hot_standby
wal_sync_method = fsync
checkpoint_segments = 30
archive_mode = on
archive_command = 'ssh postgresql@[host] test ! -f
/home/postgresql/remote_logs/%f && scp -C %p postgresql@
[host]:~/remote_logs/%f'
# REPLICATION
max_wal_senders = 1
wal_keep_segments = 20

2) Reiniciei o master

3) Executei o comando SELECT pg_start_backup('rep'); no master

4) Fiz um tarball do cluster no master

5) Executei o comando SELECT pg_stop_backup(); no master

6) Enviei o tarball para o slave e descompactei ele na localização onde
quero rodar o cluster

7) Configurei o postgresql.conf no cluster slave com os seguintes parâmetros
# WRITE AHEAD LOG
wal_level = hot_standby
wal_sync_method = fsync
checkpoint_segments = 30
# REPLICATION
hot_standby = on

8) Configurei o recovery.conf no cluster slave com os seguintes parâmetros
standby_mode = 'on'
restore_command = 'cp /home/postgresql/remote_logs/%f %p'
archive_cleanup_command = '/usr/local/postgresql/last/bin/pg_archivecleanup
/home/postgresql/remote_logs %r'

9) Movi o conteudo dp pg_xlog do slave para a pasta de recovery, sem
sobreescrever eventuais arquivos já existentes
bash $ mv -i $PGDATA/pg_xlog/0000000* /home/postgresql/remote_logs/
bash $ rm -rf $PGDATA/pg_xlog/*
10) Iniciei o cluster do slave
pg_ctl start


Nesse momento, o cluster iniciou normalmente. Porém, acompanhando os logs,
ele fica insistentemente tentando recuperar o mesmo WAL file. Segue trecho
de log:

<|||2011-10-25 09:43:46.536 BRST>LOG: database system is shut down
<|||2011-10-25 09:43:47.954 BRST>LOG: database system was shut down in
recovery at 2011-10-25 09:43:46 BRST
<|||2011-10-25 09:43:47.954 BRST>LOG: entering standby mode
<|||2011-10-25 09:43:47.977 BRST>LOG: restored log file
"000000010000000000000009" from archive
<|||2011-10-25 09:43:47.979 BRST>LOG: redo starts at 0/9000020
<|||2011-10-25 09:43:47.980 BRST>LOG: record with zero length at 0/9005330
<|||2011-10-25 09:43:48.006 BRST>LOG: restored log file
"000000010000000000000009" from archive
<|||2011-10-25 09:43:48.006 BRST>LOG: record with zero length at 0/9005330
<|||2011-10-25 09:43:52.038 BRST>LOG: restored log file
"000000010000000000000009" from archive
<|||2011-10-25 09:43:52.039 BRST>LOG: record with zero length at 0/9005330

E fica repetindo as ultimas duas linhas a cada 5 segundos.

O que estou fazendo de errado?

Att.
Leonardo "Chester" Carneiro
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a