St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a...
Transcript of St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a...
![Page 1: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/1.jpg)
Streaming Replication, the basicsPGDAY BELGIUM 2019
Stefan Fercot
17 May 2019
1
![Page 2: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/2.jpg)
Who Am I?Stefan Fercotaka. pgstefPostgreSQL user since 2010involved in the community since 2016@dalibo since 2017
2
![Page 3: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/3.jpg)
Dalibo
Services
Support
Training
Advice
Based in FranceContributing to PostgreSQL community
3 . 1
![Page 4: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/4.jpg)
Introduction
4
![Page 5: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/5.jpg)
Write-Ahead Log (WAL)transactions written sequentially
COMMIT when data are flushed to diskWAL replay a�er a crash
make the database consistent
5
![Page 6: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/6.jpg)
PostgreSQL WALREDO log only
no UNDO log (yet)instant rollback
6
![Page 7: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/7.jpg)
StructureWAL is divided into WAL segments
each segment is a file in pg_wal directory$ ls pg_wal/
00000001000000010000002E
00000001000000010000002F
000000010000000000000030
...
7
![Page 8: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/8.jpg)
Filenames00000001000000010000002E
00000001 : TLI000000010000002E : LSN
00000001 : log id0000002E : segment number
8
![Page 9: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/9.jpg)
Checkpointsflush all data pages to diskwrite a checkpoint recordrecycle / remove old WAL
9
![Page 10: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/10.jpg)
Archivingold WAL segments are deleted / recycled a�er a checkpointcan also be archived with archive_command
Allows online backups and Point-in-Time Recovery
10
![Page 11: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/11.jpg)
Replicationapply WAL when generated on a standby server
using WAL archives (files)or by streaming over a TCP connection
11
![Page 12: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/12.jpg)
Streaming Replicationarchitecture/compile flag dependentwhole cluster onlyread-only standbyno built-in cluster managementno (easy) fail-back
12
![Page 13: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/13.jpg)
Setup
13
![Page 14: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/14.jpg)
wal_levelwal_level = 'replica'
14
![Page 15: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/15.jpg)
max_wal_sendersmax_wal_senders=10 (default from v10)
15
![Page 16: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/16.jpg)
AuthenticationOn primary
CREATE ROLE replicator WITH LOGIN REPLICATION;
… and setup a passwordin pg_hba.conf
host replication replicator standby_ip/32 md5
16
![Page 17: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/17.jpg)
Data initialization
before v10, add -X stream
$ pg_basebackup -D /var/lib/pgsql/11/data \
-h primary -U replicator -R -P
17
![Page 18: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/18.jpg)
recovery.confstandby_modeprimary_conninforecovery_target_timeline
18
![Page 19: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/19.jpg)
standby_modestandby_mode=on
continuous recovery by fetching new WAL segmentsusing restore_commandby connecting to the primary server
19
![Page 20: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/20.jpg)
primary_conninfoprimary_conninfo = 'user=replicator host=primary'
connection string to the primary server
20
![Page 21: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/21.jpg)
recovery_target_timelineparticular timeline for recovery
latest is useful in a standby servernew timeline created a�er a recovery
to identify the series of WAL records generated a�erwards
21
![Page 22: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/22.jpg)
PostgreSQL 12 changes“Integrate recovery.conf into postgresql.conf” (2018-11-25)
recovery.signal / standby.signalpg_basebackup -R append postgresql.auto.conf
22
![Page 23: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/23.jpg)
Start# systemctl start postgresql-11
23
![Page 24: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/24.jpg)
ProcessesOn primary:
walsender replicator ... streaming 0/3BD48728
On standby:
walreceiver streaming 0/3BD48728
24
![Page 25: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/25.jpg)
Monitoringlag
amount of WAL records generated in the primarynot yet received / applied on the standby
pg_current_wal_lsn() on the primarypg_last_wal_receive_lsn() , pg_last_wal_replay_lsn() on the
standby
25
![Page 26: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/26.jpg)
pg_stat_replicationOn primary:
usename | replicator
application_name | walreceiver
state | streaming
sent_lsn | 0/3BD48728
write_lsn | 0/3BD48728
flush_lsn | 0/3BD48728
replay_lsn | 0/3BD48728
sync_state | async
...
26
![Page 27: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/27.jpg)
pg_stat_wal_receiverOn standby:
status | streaming
received_lsn | 0/3BD48728
received_tli | 1
...
27
![Page 28: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/28.jpg)
Fail-over
28
![Page 29: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/29.jpg)
Split-brainif standby server becomes new primary
make sure the old primary is no longer the primaryavoid situations where both systems think they are the primary
lead to confusion and ultimately data loss
29
![Page 30: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/30.jpg)
Check-up before clean promoteOn primary:
On standby:
# systemctl stop postgresql-11
$ pg_controldata -D /var/lib/pgsql/11/data/ \
| grep -E '(Database cluster state)|(REDO location)'
Database cluster state: shut down
Latest checkpoint's REDO location: 0/3BD487D0
$ psql -c 'CHECKPOINT;'
$ pg_controldata -D /var/lib/pgsql/11/data/ \
| grep -E '(Database cluster state)|(REDO location)'
Database cluster state: in archive recovery
Latest checkpoint's REDO location: 0/3BD487D0
30
![Page 31: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/31.jpg)
Promotepg_ctl promote [-D datadir] [-W] [-t seconds] [-s]
trigger_file in recovery.conf
31
![Page 32: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/32.jpg)
Logs a�er promoteLOG: received promote request
LOG: redo done at 0/3BD487D0
LOG: last completed transaction was at log time ...
LOG: selected new timeline ID: 2
LOG: archive recovery complete
LOG: database system is ready to accept connections
32
![Page 33: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/33.jpg)
Fail-backold primary as a standby
full copy of the new primarypg_rewind
--source-pgdata
--source-server
33
![Page 34: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/34.jpg)
pg_rewindrewinding a cluster until its divergence with anotherneeds wal_log_hints or data checksums--dry-run
34
![Page 35: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/35.jpg)
pg_rewind (2)$ pg_rewind -D /var/lib/pgsql/11/data/ \
--source-server="user=postgres host=primary" -P
connected to server
servers diverged at WAL location 0/3BD48840 on timeline 1
rewinding from last common checkpoint at 0/3BD487D0 on timeline 1
reading source file list
reading target file list
reading WAL in target
need to copy 196 MB (total source directory size is 561 MB)
200806/200806 kB (100%) copied
creating backup label and updating control file
syncing target data directory
Done!
35
![Page 36: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/36.jpg)
TroublesWhat if the connection between primary and standby fails?
36
![Page 37: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/37.jpg)
Replication slotsprimary does not remove WAL segments
until received by all standbyspg_create_physical_replication_slot('slot_name');
primary_slot_name
max_replication_slots = 10 (default from v10)
37
![Page 38: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/38.jpg)
Log-shippingDon’t prevent the removal of old WAL segments, use the archives!
restore_command
archive_cleanup_command = 'pg_archivecleanup /path/to/archive %r'
38
![Page 39: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/39.jpg)
PITRCombine with PITR backups for easier fail-backs!
online backupsthe standby use archives from the PITR repository
to catchup the primaryfaster standby creation through backup restore
or refresh an old one
39
![Page 40: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/40.jpg)
Synchronous replicationsynchronous_commit
offlocalremote_writeonremote_apply
can be applied by transaction
40
![Page 41: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/41.jpg)
synchronous_standby_namesSingle (9.1)
synchronous_standby_names = s1,s2,s3
First (9.6)synchronous_standby_names = 2(s1,s2,s3)
Quorum (10)synchronous_standby_names = ANY 2(s1,s2,s3)
41
![Page 42: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/42.jpg)
Hot standby and conflictsDROP TABLE on primary…
cannot wait for the end of queries on standbyon standby ( max_standby_archive_delay andmax_standby_streaming_delay )
delay application of WAL recordor cancel the conflicting query
42
![Page 43: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/43.jpg)
Early cleanupcleanup on the primary
according to MVCC rulesremove row versions still visible to a transaction on the standby
hot_standby_feedback
or replication slots…
43
![Page 44: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/44.jpg)
Updatesdifferent minor release on primary and standby usually works
not advised!update the standby servers first
44
![Page 45: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/45.jpg)
Tools
45
![Page 46: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/46.jpg)
Automated Fail-overPatronirepmgrPAF
46
![Page 47: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/47.jpg)
PatroniPython“template” for high-availability
with ZooKeeper, etcd, Consul or Kubernetesintegrates with HAProxy
47
![Page 48: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/48.jpg)
repmgrfewer prerequisiteseasier for manual processing
repmgrd for automatic fail-overwitness to avoid split-brain
no connection management
48
![Page 49: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/49.jpg)
PAFagent for Pacemaker/Corosync
linux HApossible management of other services
connection routing with virtual IPSTONITH
49
![Page 50: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/50.jpg)
PITRpgBackRest, …
… but that’s for another talk!
50
![Page 51: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/51.jpg)
pgBackRest Main Featurescustom protocol
local or remote operation (via SSH)multi-processfull/differential/incremental backupbackup rotation and archive expirationparallel, asynchronous WAL push and getAmazon S3 supportencryption…
51
![Page 52: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/52.jpg)
Logical Replicationreconstructs changes by rowreplicates row content, not SQL statementstable-level partial / bi-directional replicationdata replication only
no schemano sequences
suitable for data distributionbut not for HA !
52
![Page 53: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/53.jpg)
Conclusionconsolidated during 9.x versionsout of the box in 10
wal_levelmax_wal_senders…
53
![Page 54: St ream in g Re pl icat io n , t h e basics · CREATE ROLE replicator WITH LOGIN REPLICATION; … a nd setup a pa sswor d i n pg_hba.conf host replication replicator standby_ip/32](https://reader034.fdocuments.in/reader034/viewer/2022050423/5f9234e98f97856e28573927/html5/thumbnails/54.jpg)
Thank you for your attention!
54