SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
Linux‐HA
+
DRBD
+
PostgreSQL


          Jesse
Young

Target
Audience

•  System
Administrators

•  DBAs
looking
into
replicaBon

Goals

•    Inspire
more
replicaBon
discussions

•    Inform
System
Admins/DBAs

•    Describe
components

•    Simple
Setup

•    DemonstraBon

•    Performance
Tips

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

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

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.

DRBD

•  Distributed
Replicated
Block
Device

     •  Mirrored
storage
across
servers





                                           Image
from
h_p://www.drbd.org

PostgreSQL

•  Database
engine
we
all
know
and
love

Setup

•    Dual‐proc
Quad‐core
Intel
Xeon
@
2.66
GHz

•    16GB
RAM

•    2x
74
GB
SCSI
@
15kRPM
(RAID
1
‐
OS)

•    6x
300
GB
SCSI
@
10kRPM
(RAID
10
–
DRBD)

•    LSI
Megaraid
–
2
Channel,
512
MB
Cache
w/

     BBU

Quick
Install

•  Versions

   –  heartbeat‐2.0.8

   –  drbd‐8.0.5

   –  PostgreSQL
–
Any
version

Install
DRBD

•  Compile
from
source

or

•  yum
install
drbd
kmod‐drbd

Configure
DRBD

resource
postgres
{


on
node‐001
{






device
/dev/drbd0;






disk


/dev/sdb1;






address
10.40.0.1:7788;






meta‐disk

internal;



}




on
node‐002
{






device
/dev/drbd0;






disk


/dev/sdb1;






address
10.40.0.2:7788;






meta‐disk

internal;



}

}

Begin
DRBD

•  Each
node:

  –  modprobe
drbd

  –  drbdadm
create‐md
postgres

  –  drbadm
up
all

Create
ParBBon
on
DRBD
Device

•  Primary
node:

  –  drbdadm
‐‐
‐‐overwrite‐data‐of‐peer
primary
all

  –  mke2fs
‐j
/dev/drbd0


  –  mount
device

  –  Edit
/etc/init.d/postgresql

     •  PGDATA
to
DRBD
device

  –  initdb
or
sync/copy
exisBng
database

DRBD
status

•  cat
/proc/drbd



version:
8.0.5
(api:86/proto:86)

SVN
Revision:
3011
build
by
jesse@node‐001.zonarsystems.net,
2007‐09‐02
23:16:51


0:
cs:Connected
st:Primary/Secondary
ds:UpToDate/UpToDate
C
r‐‐‐





ns:191681144
nr:108784
dw:191798660
dr:1228217841
al:962834152
bm:9054
lo:0

      pe:0
ua:0
ap:0

     
resync:
used:0/31
hits:34633
misses:4367
starving:0
dirty:0
changed:4367

     
act_log:
used:0/127
hits:11433119293
misses:1051777270
starving:11558178

      dirty:81149096
changed:962834152

Install
Linux‐HA

•  Compile
from
source

or

•  yum
install
heartbeat

Configure
Linux‐HA

•  ha.cf

•  haresources

•  authkeys

ha.cf

deadBme
120

auto_failback
off

udpport
694

ucast
eth1
10.30.0.10

node



node‐001.zonarsystems.net

node



node‐002.zonarsystems.net

haresources

cluster‐001.zonarsystems.net

IPaddr::10.30.0.101/24
drbddisk::postgres































Filesystem::/dev/drbd0::/mnt/rod1::ext3































postgresql


MailTo::jesse@zonarsystems.com::'Zonar_Cluster‐001_Switch'

authkeys

auth
1

1
sha1
f93e5e562d430dae92b7fd7b272c13bb0c5de0e2

Start
Linux‐HA

•  /etc/init.d/heartbeat
start

DEMO

Problems?

•  Secondary
server
always
stand‐by

•  Failed
node
can
cause
slow
downs

•  Kernel
module

Performance?

•  dd
if=/dev/zero
of=/mnt/drbd/pgwest/test
bs=8192

   count=2000000


•  DRBD
device

   –  ~85
MB/s

•  Disk
device

   –  121MB/s



        30%
write performance
degradaBon

Problems?

Performance
Improvements

Ethernet

•  Direct
cross
over
cable

•  GigE,
10
GigE

•  1500
MTU
vs
9000
MTU

RAID
Cards

•  Capable
of
WRITEBACK

•  Write
caching

•  Ba_ery
backup
unit
(BBU)

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

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

YMMV

•  Remember
to
test
yourself

•  Fedora/e1000
network
stack
issues

•  DRBD
is
soYware
too,
bugs
come
up

Other

Uses

            HA‐Linux
+
DRBD
+
???

•  Mail

•  NFS

•  MySQL

QuesBons?

Links

•  Linux‐HA:
h_p://www.linux‐ha.org

•  DRBD:
h_p://www.drbd.org

Demo
(backup
plan)

Host:
c6a

Host:
c6a

Host:
c6a

Host:
c6a

Host:
c6a

Host:
c6b

Host:
c6b

Host:
c6a


Más contenido relacionado

Similar a HA+DRBD+Postgres - PostgresWest '08

Timm – Telecom Network Module Management
Timm – Telecom Network Module ManagementTimm – Telecom Network Module Management
Timm – Telecom Network Module Managementrasour
 
The Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoThe Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoVenture Hacks
 
Capacity Planning for Cloud Computing
Capacity Planning for Cloud ComputingCapacity Planning for Cloud Computing
Capacity Planning for Cloud ComputingAdrian Cockcroft
 
The Yahoo Open Stack
The Yahoo Open StackThe Yahoo Open Stack
The Yahoo Open StackMegan Eskey
 
UW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance TestingUW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance TestingChris Sterling
 
Scalability without going nuts
Scalability without going nutsScalability without going nuts
Scalability without going nutsJames Cox
 
Yakov Fain - Design Patterns a Deep Dive
Yakov Fain - Design Patterns a Deep DiveYakov Fain - Design Patterns a Deep Dive
Yakov Fain - Design Patterns a Deep Dive360|Conferences
 
LSG Webinar - 13 Nov 08
LSG Webinar - 13 Nov 08LSG Webinar - 13 Nov 08
LSG Webinar - 13 Nov 08Barry Sampson
 
Gmr Highload Presentation Revised
Gmr Highload Presentation RevisedGmr Highload Presentation Revised
Gmr Highload Presentation RevisedOntico
 
Gmr Highload Presentation
Gmr Highload PresentationGmr Highload Presentation
Gmr Highload PresentationOntico
 
2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By StepEric Ries
 
PEtALS Distributed Service Bus Illustrated
PEtALS Distributed Service Bus IllustratedPEtALS Distributed Service Bus Illustrated
PEtALS Distributed Service Bus IllustratedChristophe Hamerling
 
Delivery Context Descriptions - A Comparison and Mapping Model
Delivery Context Descriptions - A Comparison and Mapping ModelDelivery Context Descriptions - A Comparison and Mapping Model
Delivery Context Descriptions - A Comparison and Mapping ModelAlpen-Adria-Universität
 
Fedora App Slide 2009 Hastac
Fedora App Slide 2009 HastacFedora App Slide 2009 Hastac
Fedora App Slide 2009 HastacLoretta Auvil
 
GIPA
GIPAGIPA
GIPAESUG
 

Similar a HA+DRBD+Postgres - PostgresWest '08 (20)

Timm – Telecom Network Module Management
Timm – Telecom Network Module ManagementTimm – Telecom Network Module Management
Timm – Telecom Network Module Management
 
The Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoThe Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 Expo
 
Capacity Planning for Cloud Computing
Capacity Planning for Cloud ComputingCapacity Planning for Cloud Computing
Capacity Planning for Cloud Computing
 
The Yahoo Open Stack
The Yahoo Open StackThe Yahoo Open Stack
The Yahoo Open Stack
 
Rich Web Clients 20081118
Rich Web Clients 20081118Rich Web Clients 20081118
Rich Web Clients 20081118
 
UW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance TestingUW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
 
Scalability without going nuts
Scalability without going nutsScalability without going nuts
Scalability without going nuts
 
Yakov Fain - Design Patterns a Deep Dive
Yakov Fain - Design Patterns a Deep DiveYakov Fain - Design Patterns a Deep Dive
Yakov Fain - Design Patterns a Deep Dive
 
Genome Browser
Genome BrowserGenome Browser
Genome Browser
 
Preon (J-Fall 2008)
Preon (J-Fall 2008)Preon (J-Fall 2008)
Preon (J-Fall 2008)
 
LSG Webinar - 13 Nov 08
LSG Webinar - 13 Nov 08LSG Webinar - 13 Nov 08
LSG Webinar - 13 Nov 08
 
Gmr Highload Presentation Revised
Gmr Highload Presentation RevisedGmr Highload Presentation Revised
Gmr Highload Presentation Revised
 
Gmr Highload Presentation
Gmr Highload PresentationGmr Highload Presentation
Gmr Highload Presentation
 
2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step
 
PEtALS Distributed Service Bus Illustrated
PEtALS Distributed Service Bus IllustratedPEtALS Distributed Service Bus Illustrated
PEtALS Distributed Service Bus Illustrated
 
Delivery Context Descriptions - A Comparison and Mapping Model
Delivery Context Descriptions - A Comparison and Mapping ModelDelivery Context Descriptions - A Comparison and Mapping Model
Delivery Context Descriptions - A Comparison and Mapping Model
 
Fedora App Slide 2009 Hastac
Fedora App Slide 2009 HastacFedora App Slide 2009 Hastac
Fedora App Slide 2009 Hastac
 
Revisited
RevisitedRevisited
Revisited
 
GIPA
GIPAGIPA
GIPA
 
Grails Overview
Grails OverviewGrails Overview
Grails Overview
 

Último

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

HA+DRBD+Postgres - PostgresWest '08