This document provides an overview of setting up high availability for PostgreSQL using Linux-HA, DRBD, and PostgreSQL. It describes the goals of inspiring more replication discussions and informing admins. It then covers installing and configuring Linux-HA and DRBD for data mirroring across two servers, setting up PostgreSQL to use the mirrored storage, some performance tests showing a 30% write degradation, and tips for improving performance like using writeback mode on the RAID cards.
4. Intro
• Zonar Systems, Inc.
– 45,000 vehicles sending data in 24/7 and growing
– 15 database servers
– 5 TB data, growing ~25GB daily
– PostgreSQL + PostGIS
5. Why use Linux‐HA + DRBD?
• Simple replicaBon
• GPS data coming into the system 24/7
• MiBgate problems from server hardware
• Users and IntegraBon soYware access
6. Linux‐HA
• “Provide a high availability (clustering)
solu6on for Linux which promotes reliability,
availability, and serviceability (RAS) through a
community development effort.”
• System Admins: You can conBnue to (half)
sleep, even if a server dies.
30. Writeback VS. Writethrough
100
• Writeback 90
80
– 80MB/s – 94MB/s 70
60
50
40
• Writethrough 30
– 61MB/s – 71MB/s 20
10
0
Run Run Run Run Run Run Run Run
1 3 5 7 9 11 13 15
31. DRBD Protocols
• Protocol A
– DRBD waits for local disk and local TCP send buffer
• Protocol B
– DRBD waits for local disk and remote buffer cache
• Protocol C
– DRBD waits for both local and remote disk
– SAFEST