odoo disaster recovery with barman

51
COLD SWEAT

Upload: odoo

Post on 09-May-2015

3.125 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Odoo disaster recovery with barman

COLD SWEAT

Page 2: Odoo disaster recovery with barman
Page 3: Odoo disaster recovery with barman
Page 4: Odoo disaster recovery with barman

GABRIELE BARTOLINIOdoo OpenDays 2014

Bruxelles, June 5th

Page 5: Odoo disaster recovery with barman

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

Page 6: Odoo disaster recovery with barman

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”)

Page 7: Odoo disaster recovery with barman

AGILE BUSINESS GROUP

• Operating with Odoo since 2009

• Switzerland

• Italy

Page 8: Odoo disaster recovery with barman

GOOD LUCK, LORENZO!

• Lorenzo Battistini should have been here today

• But he’s recovering from a sport injury

Page 9: Odoo disaster recovery with barman

DISASTER RECOVERY for Odoo (and PostgreSQL databases)

Page 10: Odoo disaster recovery with barman

BE AWAREIn 2ndQuadrant, all these concepts usually fit in a 2 day

workshop on Disaster Recovery and a 1 day workshop on Barman alone

Page 11: Odoo disaster recovery with barman

BUSINESS CONTINUITYactivity 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

Page 12: Odoo disaster recovery with barman

INFORMATION TECHNOLOGY

• Business continuity

• High availability

• Disaster recovery

Page 13: Odoo disaster recovery with barman

LAW REQUIREMENTSIn Italy, the “Codice dell’Amministrazione Digitale” defines business continuity requirements for public administrations

Page 14: Odoo disaster recovery with barman

DISASTER(too late for touching wood now)

!system/hardware failures

unintentional errors natural disaster

Page 15: Odoo disaster recovery with barman

REACT TO A DISASTERRecover systems, data and infrastructures

Page 16: Odoo disaster recovery with barman

TOO LATE!Do not wait for a disaster to happen

Page 17: Odoo disaster recovery with barman

PLAN FOR DISASTERS“Disasters” will happen. Be prepared.

Page 18: Odoo disaster recovery with barman

“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

Page 20: Odoo disaster recovery with barman

ODOO DISASTER RECOVERY

Code Repository + Buildout rsync for attachments stored on file system

… then …

Page 21: Odoo disaster recovery with barman

DATABASE DISASTER RECOVERY

Let’s just focus on databases!

Page 22: Odoo disaster recovery with barman

REQUIREMENTS

• Automated backups

• Notifications (anomalies)

• Frequency of backups

• Retention policies

• Data protection

• Availability for recovery

Page 23: Odoo disaster recovery with barman

TYPES OF BACKUP

• Full backup

• Incremental backup

• Differential backup

• Hot backup

• Logical backup

• Physical backup

Page 24: Odoo disaster recovery with barman

POSTGRES BACKUP

• Hot backup

• MVCC (core)

• Logical Backup

• pg_dump

!

!

• Physical Backup

• Full backup (base backup)

• Differential backup (WAL)

• Incremental backup

• N/A

Page 25: Odoo disaster recovery with barman

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

Page 26: Odoo disaster recovery with barman

WWW.PGBARMAN.ORG

Page 27: Odoo disaster recovery with barman

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

Page 28: Odoo disaster recovery with barman

Postgres Postgres Postgres

Barman

LAN, centralised architecture

Barman

LAN, hybrid architecture

tape

Page 29: Odoo disaster recovery with barman

Postgres

Barman

Geographic redundancy

Barman

data centre 1 data centre 2

rsync

Page 30: Odoo disaster recovery with barman

Postgres

Barman

Continuous archiving (WAL shipping via SSH)

SSH commands SQL commands

Page 31: Odoo disaster recovery with barman

secure channel

Postgres Barman

WAL cron

Barman’s WAL archive

Page 32: Odoo disaster recovery with barman

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 backupBackup catalogue

Page 33: Odoo disaster recovery with barman

how hard is it to instruct Barman to take a full backup for

a given server?

Page 34: Odoo disaster recovery with barman

barman backup SERVER_ID

Page 35: Odoo disaster recovery with barman
Page 36: Odoo disaster recovery with barman

Now … can you guess how to ask Barman to recover a

server using an existing backup?

Page 37: Odoo disaster recovery with barman

barman recover SERVER_ID BACKUP_ID

Page 38: Odoo disaster recovery with barman
Page 39: Odoo disaster recovery with barman

RECOVERY CONTROL

• Recovery target (full / point in time)

• Local recovery

• barman recover

• Remote recovery

• barman recover --remote-ssh-command

Page 40: Odoo disaster recovery with barman

COMMON USE CASES

• Unintentional errors recovery

• Disaster recovery

• Sandbox server (BI, staging, ...)

Page 41: Odoo disaster recovery with barman

RETENTION POLICIES

• User-defined policy

• How long backups are retained for recovery

• Point of recoverability

• REDUNDANCY

• RECOVERY WINDOW

Page 42: Odoo disaster recovery with barman

RETENTION POLICY CONFIGURATION

; Base backup retention policy!retention_policy = 'redundancy 3'!retention_policy = 'recovery window of 3 months'

Page 43: Odoo disaster recovery with barman

BACKLOG• Incremental backup

• TAR format for backups

• Export/Import of backups

• External backups

• Replication protocol support

• 0 Data Loss support

• … and much more

• See TODO file

Page 44: Odoo disaster recovery with barman

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

Page 45: Odoo disaster recovery with barman

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)

Page 46: Odoo disaster recovery with barman

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)

Page 47: Odoo disaster recovery with barman

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)

Page 48: Odoo disaster recovery with barman

TIME TO ...yum install barman

apt-get install barman

Page 49: Odoo disaster recovery with barman

[email protected]

Twitter : @_GBartolini_ www.2ndQuadrant.com

www.pgbarman.org

[email protected] Twitter : @elbaddy www.agilebg.com

Page 50: Odoo disaster recovery with barman

THANK YOU!

Page 51: Odoo disaster recovery with barman

LICENSE

Copyright (c) 2012, 2014 - 2ndQuadrant.it