Re: streaming replication question - Mailing list pgsql-general

From wd
Subject Re: streaming replication question
Date
Msg-id CABexzmgehGZegxn1HDU2Y33h3JME6WFJz=XJjibXdfFjPt0=jA@mail.gmail.com
Whole thread Raw
In response to streaming replication question  (Roberto Scattini <roberto.scattini@gmail.com>)
Responses Re: streaming replication question
List pgsql-general
You can combine warm standby and streaming, we do this in our product database.
When the standby is to far from the master, the slave will try to use restore_command to restore the database(warm standby), when the standby catch up the master, the steaming will working again.

BTW: we use ominipitr.


On Fri, Mar 22, 2013 at 2:32 AM, Roberto Scattini <roberto.scattini@gmail.com> wrote:
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: Rob Sargent
Date:
Subject: Re: regexp_replace failing on 9.0.4
Next
From: Roberto Scattini
Date:
Subject: Re: streaming replication question