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.On Fri, Mar 22, 2013 at 2:32 AM, Roberto Scattini <roberto.scattini@xxxxxxxxx> wrote:
hi list,i'm installing a streaming replication master-slave setup in ubuntu 12.04 LTS, with postgresql 9.1the 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 = 5432max_connections = 100unix_socket_directory = '/var/run/postgresql'ssl = trueshared_buffers = 24MBwal_level = hot_standbyarchive_mode = onarchive_command = 'rsync -arv %p 192.168.206.133:/var/lib/postgresql/9.1/archive/%f </dev/null'archive_timeout = 900max_wal_senders = 5wal_keep_segments = 100log_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