streaming replication question - Mailing list pgsql-general

From Roberto Scattini
Subject streaming replication question
Date
Msg-id CAApYZY9Wn52XFqbzT14iPFc=BNuD-ZVAWGth+fhky_e5sXkNsA@mail.gmail.com
Whole thread Raw
Responses Re: streaming replication question
Re: streaming replication question
List pgsql-general
hi list,

i'm installing a streaming replication master-slave setup in ubuntu 12.04 LTS, with postgresql 9.1

the tutorials and the documentation are a very good start point, but i have one question related to some fine grained configurations.

it is said that i should stop the master db in order to make de starting backup, OR run pg_start_backup and keep the archive files for the slave to catch up. if i dont do this, maybe the slave stays far behind the master and the wal_segments arent enough to start the replication. 
if I understand this right, i can "combine" the old "warm standby" configs of archive_command in the master and restore command in the slave to ensure that the slave will have the necessary info to start the replication.


i mean, i can have both configurations enabled?
right now, my streaming replication setup has this configs:

recovery.conf (slave)
-----------------------------------
standby_mode = 'on'
primary_conninfo = 'host=192.168.206.134'
trigger_file = '/var/lib/postgresql/9.1/sgi/sgi.trigger'
restore_command = '/usr/lib/postgresql/9.1/bin/pg_standby -d -k 100 -s 20 -t /var/lib/postgresql/9.1/sgi.trigger /var/lib/postgresql/9.1/archive %f %p'
archive_cleanup_command = '/usr/lib/postgresql/9.1/bin/pg_archivecleanup /var/lib/postgresql/9.1/archive %r'
-----------------------------------

postgresql.conf (master)
-----------------------------------
data_directory = '/var/lib/postgresql/9.1/sgi'
hba_file = '/etc/postgresql/9.1/sgi/pg_hba.conf'
ident_file = '/etc/postgresql/9.1/sgi/pg_ident.conf'
external_pid_file = '/var/run/postgresql/9.1-sgi.pid'
listen_addresses = '*' 
port = 5432               
max_connections = 100
unix_socket_directory = '/var/run/postgresql'
ssl = true 
shared_buffers = 24MB  
wal_level = hot_standby 
archive_mode = on   
archive_command = 'rsync -arv %p 192.168.206.133:/var/lib/postgresql/9.1/archive/%f </dev/null'
archive_timeout = 900
max_wal_senders = 5 
wal_keep_segments = 100 
log_line_prefix = '%t ' 
datestyle = 'iso, mdy'
lc_messages = 'en_US.UTF-8' 
lc_monetary = 'en_US.UTF-8'  
lc_numeric = 'en_US.UTF-8'    
lc_time = 'en_US.UTF-8' 
default_text_search_config = 'pg_catalog.english'
-----------------------------------

thanks,

--
Roberto Scattini

pgsql-general by date:

Previous
From: Daniel Cristian Cruz
Date:
Subject: Re: Bad plan on a huge table query
Next
From: Roberto Scattini
Date:
Subject: Re: streaming replication question