Odoo disaster recovery with barman

5,230 views
5,009 views

Published on

Published in: Technology, Business

Odoo disaster recovery with barman

  1. 1. COLD SWEAT
  2. 2. GABRIELE BARTOLINI Odoo OpenDays 2014 Bruxelles, June 5th
  3. 3. GABRIELE BARTOLINI • Co-Founder and Managing Director of 2ndQuadrant Italia • Data Architect, Business critical environments • Data warehousing • Co-Founder Italian PostgreSQL Users Group • Co-Founder PostgreSQL Europe • PostgreSQL Contributor and Advocate
  4. 4. 2NDQUADRANT • UK company founded by Simon Riggs (Postgres committer) • Open Source business model • Offices in Europe,America and Asia/Pacific • Platinum sponsor of PostgreSQL • Leaders in HA, Disaster Recovery, Scalability, Performance • 24/7 support service (“Follow the sun”)
  5. 5. AGILE BUSINESS GROUP • Operating with Odoo since 2009 • Switzerland • Italy
  6. 6. GOOD LUCK, LORENZO! • Lorenzo Battistini should have been here today • But he’s recovering from a sport injury
  7. 7. DISASTER RECOVERY for Odoo (and PostgreSQL databases)
  8. 8. BE AWARE In 2ndQuadrant, all these concepts usually fit in a 2 day workshop on Disaster Recovery and a 1 day workshop on Barman alone
  9. 9. BUSINESS CONTINUITY activity performed by an organisation to ensure that critical business functions will be available to customers, suppliers, regulators, and other entities that must have access to those functions - Wikipedia
  10. 10. INFORMATIONTECHNOLOGY • Business continuity • High availability • Disaster recovery
  11. 11. LAW REQUIREMENTS In Italy, the “Codice dell’Amministrazione Digitale” defines business continuity requirements for public administrations
  12. 12. DISASTER (too late for touching wood now) ! system/hardware failures unintentional errors natural disaster
  13. 13. REACTTO A DISASTER Recover systems, data and infrastructures
  14. 14. TOO LATE! Do not wait for a disaster to happen
  15. 15. PLAN FOR DISASTERS “Disasters” will happen. Be prepared.
  16. 16. “Plans are worthless, but planning is everything. There is a very great distinction because when you are planning for an emergency you must start with this one thing: the very definition of "emergency" is that it is unexpected, therefore it is not going to happen the way you are planning.” - Dwight D. Eisenhower
  17. 17. REGULAR CRASHTESTS
  18. 18. ODOO DISASTER RECOVERY Code Repository + Buildout rsync for attachments stored on file system … then …
  19. 19. DATABASE DISASTER RECOVERY Let’s just focus on databases!
  20. 20. REQUIREMENTS • Automated backups • Notifications (anomalies) • Frequency of backups • Retention policies • Data protection • Availability for recovery
  21. 21. TYPES OF BACKUP • Full backup • Incremental backup • Differential backup • Hot backup • Logical backup • Physical backup
  22. 22. POSTGRES BACKUP • Hot backup • MVCC (core) • Logical Backup • pg_dump ! ! • Physical Backup • Full backup (base backup) • Differential backup (WAL) • Incremental backup • N/A
  23. 23. OUR GOALS • Hot, Full, Differential and Incremental backups • Multiple servers • Remote backup & recovery • Backup catalogues • Retention policies • Archival and compression • WAL segments • Periodical backups • Automation • Integration • Usability
  24. 24. WWW.PGBARMAN.ORG
  25. 25. BARMAN • Started in 2011 • GNU GPL 3 • Hosted on Sourceforge.net • Linux • Python 2.6/2.7 (3.0 exp.) • PostgreSQL 8.4 to 9.3 • Designed, developed, maintained by 2ndQuadrant
  26. 26. Postgres Postgres Postgres Barman LAN, centralised architecture Barman LAN, hybrid architecture tape
  27. 27. Postgres Barman Geographic redundancy Barman data centre 1 data centre 2 rsync
  28. 28. Postgres Barman Continuous archiving (WAL shipping via SSH) SSH commands SQL commands
  29. 29. secure channel Postgres Barman WAL cron Barman’s WAL archive
  30. 30. Postgres Full backup - Sat 1, 4AM Full backup - Sat 8, 4AM Full backup - Sat 15, 4AM Full backup - Sat 22, 4AM Barman Periodical backup (weekly) Differential backup Backup catalogue
  31. 31. how hard is it to instruct Barman to take a full backup for a given server?
  32. 32. barman backup SERVER_ID
  33. 33. Now … can you guess how to ask Barman to recover a server using an existing backup?
  34. 34. barman recover SERVER_ID BACKUP_ID
  35. 35. RECOVERY CONTROL • Recovery target (full / point in time) • Local recovery • barman recover • Remote recovery • barman recover --remote-ssh-command
  36. 36. COMMON USE CASES • Unintentional errors recovery • Disaster recovery • Sandbox server (BI, staging, ...)
  37. 37. RETENTION POLICIES • User-defined policy • How long backups are retained for recovery • Point of recoverability • REDUNDANCY • RECOVERY WINDOW
  38. 38. RETENTION POLICY CONFIGURATION ; Base backup retention policy! retention_policy = 'redundancy 3'! retention_policy = 'recovery window of 3 months'
  39. 39. BACKLOG • Incremental backup • TAR format for backups • Export/Import of backups • External backups • Replication protocol support • 0 Data Loss support • … and much more • SeeTODO file
  40. 40. OUR COMMITMENT • Keep it open source • Reinvest money from sale of DR turnkey solutions in R&D • Support and maintain RPM/Debian packages • Accept sponsorships for new features development
  41. 41. ADYEN Adyen is a global multichannel payment company offering businesses an outsourced payment solution, which enables merchants to accept payments from anywhere in the world and provides a global payment solution for mid, large and enterprise e- commerce merchants. Sponsors of Backup from Standby (1.3.1)
  42. 42. CSI PIEMONTE (One of the top 10 ICT companies in Italy for revenue) “We found in Barman the optimal solution for physical backup and disaster recovery of PostgreSQL databases. Barman is robust and easy to use. Its command interface allows an easy integration with the existing management tools in our enviroment.” Sponsors of RPM package and WAL compression (1.0)
  43. 43. CONCLUSIONS • Hides complexity of PITR / Keeps unaltered PITR strenghts • Not invasive • Fosters migrations from Oracle • “Standard de facto” for PostgreSQL Disaster Recovery • Advice: plan for DR (if you have not done it yet)
  44. 44. TIMETO ... yum install barman apt-get install barman
  45. 45. QUESTIONS? Gabriele.Bartolini@2ndQuadrant.it Twitter: @_GBartolini_ www.2ndQuadrant.com www.pgbarman.org lorenzo.battistini@agilebg.com Twitter: @elbaddy www.agilebg.com
  46. 46. THANKYOU!
  47. 47. LICENSE Copyright (c) 2012, 2014 - 2ndQuadrant.it

×