postgresqlHow do I set up PostgreSQL replication?
Setting up PostgreSQL replication
- Create a master server and a slave server.
 - On the master server, edit the postgresql.conf file and set the following parameters:
wal_level = hot_standby max_wal_senders = 10 wal_keep_segments = 8 - Restart the master server.
 - On the slave server, edit the postgresql.conf file and set the following parameters:
hot_standby = on - Create a recovery.conf file on the slave server with the following content:
standby_mode = 'on' primary_conninfo = 'host=<master_host> port=<master_port> user=<replication_user> password=<replication_password>' trigger_file = '/tmp/postgresql.trigger.5432' - Restart the slave server.
 - On the master server, create a replication user with REPLICATION privilege.
 
Helpful links
More of Postgresql
- How can I troubleshoot zero damaged pages in PostgreSQL?
 - How do I use PostgreSQL's XMLTABLE to parse XML data?
 - How can I use PostgreSQL and ZFS snapshots together?
 - How do I use PostgreSQL ZonedDateTime to store date and time information?
 - How can I extract the year from a date in PostgreSQL?
 - How do I use PostgreSQL's XMIN and XMAX features?
 - How can I use PostgreSQL XOR to compare two values?
 - How can I set a PostgreSQL interval to zero?
 - How can I monitor PostgreSQL performance using Zabbix?
 - How can I use PostgreSQL with YAML?
 
See more codes...