streaming replication question

From: Roberto Scattini <roberto(dot)scattini(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: streaming replication question
Date: 2013-03-21 18:32:08
Message-ID: CAApYZY9Wn52XFqbzT14iPFc=BNuD-ZVAWGth+fhky_e5sXkNsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roberto Scattini 2013-03-21 18:45:43 Re: streaming replication question
Previous Message Daniel Cristian Cruz 2013-03-21 17:53:48 Re: Bad plan on a huge table query