postgresql streaming replication on windows

step 1:
master pg_hba.conf :
add
host    replication     rep             127.0.0.1/32           trust

master postgresql.conf :
modify
listen_addresses = '*'
wal_level = hot_standby
archive_mode = on
archive_command = 'copy "%p" "D:\\cliScript\\I.ECViewProDB\\%f"'
max_wal_senders = 1
wal_keep_segments = 10

step 2:
slave postgresql.conf :
listen_addresses = '*'
hot_standby = on

slave create recovery.conf
add
restore_command = 'copy "D:\\cliScript\\I.ECViewProDB\\%f" "%p"'
standby_mode = 'on'
primary_conninfo = 'host = 127.0.0.1 port = 5557 user = rep password = rep'
trigger_file = 'D:\\cliScript\\I.ECViewProDB\\failover.txt'

step 3:
sql command : select pg_start_backup('ecview')
copy db content to slave exclude pg_hba.conf, pg_ident.conf, postgresql.conf, postmaster.pid
sql command : select pg_stop_backup()

reference : postgresql stream replication on windows 2008
科學網

留言

這個網誌中的熱門文章

Embedded Tomcat

COSCUP2010

SWT SSH terminal