Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Postgresql for Alfresco: The practical guide

263 views

Published on

Presentation about Postgresql Master-Slave, point in time recovery and upgrading without downtime using pglogical, all applied on Alfresco.

Published in: Technology
  • Be the first to comment

Postgresql for Alfresco: The practical guide

  1. 1. POSTGRESQLPOSTGRESQL FOR ALFRESCOFOR ALFRESCO THE PRACTICAL GUIDETHE PRACTICAL GUIDE Created by Thijs Lemmens
  2. 2. Working at Xenit since 2011 Big archiving use cases Strong interest in PostgreSQL ABOUT MEABOUT ME
  3. 3. OUTLINEOUTLINE HA: Master - Slave Failover Continuous backup - Point-in-time Recovery Database upgrade without downtime
  4. 4. STREAMING REPLICATIONSTREAMING REPLICATION
  5. 5. SYNCHRONOUSSYNCHRONOUS Data security Safe failover ASYNCHRONOUSASYNCHRONOUS High availability Performance DILEMMADILEMMA
  6. 6. CONFIGURATION: MASTERCONFIGURATION: MASTER postgresql.conf: wal_level = hot_standby # or higher max_wal_senders = 20
  7. 7. CONFIGURATION: MASTERCONFIGURATION: MASTER pg_hba.conf: host replication repuser 172.18.0.0 255.255.255.0 md5
  8. 8. CONFIGURATION: SLAVECONFIGURATION: SLAVE pg_basebackup --pgdata=datadir --xlog-method=stream --write-recovery-conf --progress --dbname="host=pgmaster port=5432 user=repuser password=pwd"
  9. 9. CONFIGURATION: ALFRESCOCONFIGURATION: ALFRESCO jdbc:postgresql://pgmaster:5432,pgslave:5432/alfresco
  10. 10. STREAMING BACKUPSTREAMING BACKUP
  11. 11. STREAMING BACKUPSTREAMING BACKUP start from a base backup archive the wal files regular bookkeeping (use a tool)
  12. 12. STREAMING BACKUP:STREAMING BACKUP: CONFIGURATIONCONFIGURATION postgresql.conf: archive_mode = on archive_command = 'test ! -f /wal_archive/%f && cp %p /wal_archive/%f'
  13. 13. RESTORE: CONFIGURATIONRESTORE: CONFIGURATION recovery.conf: restore_command = 'cp /wal_archive/%f %p' recovery_target_time = '2018-01-09 09:39:50'
  14. 14. DEMO: POINT IN TIME RECOVERYDEMO: POINT IN TIME RECOVERY
  15. 15. DATABASE UPGRADE WITHOUTDATABASE UPGRADE WITHOUT DOWNTIMEDOWNTIME
  16. 16. addon from 2nd Quadrant sql-like replication of changes to a db cross version (9.4 -> 10) built in version in postgresql 10 per database replication LOGICAL REPLICATIONLOGICAL REPLICATION
  17. 17. LOGICAL REPLICATION SETUP ONLOGICAL REPLICATION SETUP ON OLD VERSIONOLD VERSION Dump the database (scheme only) Create the extension Create provider node Register tables to provider Register sequences to subscriber
  18. 18. LOGICAL REPLICATION SETUP ONLOGICAL REPLICATION SETUP ON NEW VERSIONNEW VERSION Restore the database (scheme only) Create the extension Create subscriber node Register subscription to provider
  19. 19. DEMO: DB UPGRADE WITHOUTDEMO: DB UPGRADE WITHOUT DOWNTIMEDOWNTIME
  20. 20. SOURCESSOURCES https://blog.2ndquadrant.com/evolution-of-fault-tol erance-in-postgresql-replication-phase/ https://www.postgresql.org/docs https://rosenfeld.herokuapp.com/en/articles/infrast ructure/2017-11-10-upgrading-postgresql-from-9-6- to-10-with-minimal-downtime-using-pglogical
  21. 21. THANK YOU!THANK YOU! https://github.com/thijslemmens/postgres-alfresco- presentation

×