SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
High Availability with
DRBD & Heartbeat
      Chris Barber
    http://www.cb1inc.com
What is DRBD?
●   Distributed Replicated Block Device
●   RAID 1 mirror across network
●   Realtime replications
●   Linux-only kernel module
●   2 nodes – Primary/Secondary
●   Single/Dual primary mode
●   Open source, free
Visual Overview
          Primary Server                                                          Secondary Server
      Service (MySQL, Apache, etc)                                              Service (MySQL, Apache, etc)



File system                                                                                             File system
                                          OS                          OS

Buffer cache                                                                                           Buffer cache



  DRBD                                                                                                    DRBD



   Disk                            TCP/IP                                  TCP/IP                         Disk
 Scheduler                                                                                              Scheduler



Disk Driver                      NIC Driver                              NIC Driver                     Disk Driver



                        Network Card                            Network Card
   Disk                                                                                                    Disk

                                      Network Card                            Network Card


                        Original chart: http://www.drbd.org/users-guide/ch-fundamentals.html
Uses
●   Database Server( MySQL)
●   Web Server (Apache)
●   File Server (Samba)
●   FTP
●   DNS
●   Email (Postfix)
●   Source Repository (Subversion)
My Setup
●   App 1              ●   App 2
●   AMD Opteron 180    ●   AMD Sempron 2800+
    2.4GHz dual-core   ●   3GB RAM
●   4GB RAM            ●   1 x 250 IDE Hard
●   2 x 250GB SATA         Drive
    Software RAID 1    ●   2 x Gigabit NICs
●   2 x Gigabit NICs
My Setup




App 1                 App 2

   File Server
My Setup




Gigabit
Crossover
Cable
Partitions
●   250GB total
●   20GB Operating system (/)
●   4GB swap
●   226GB DRBD (/mnt/data)
/mnt/data
●   /mnt/data/apache2 – Apache conf, SSL certs,
    htpasswd
●   /mnt/data/mail – Mail directory
    (Postfix/CourierIMAP)
●   /mnt/data/mysql – MySQL conf, database files,
    binlog
●   /mnt/data/svn – Subversion repository
●   /mnt/data/www - Websites
DRBD Install Overview
●   Download source
●   Compile driver
●   modprobe drbd
●   Create /etc/drbd.conf
●   Create meta disk - drbdadm create-md r0
●   Bring up device - drbdadm up r0
●   Become primary
    –   drbdadm -- --overwrite-data-of-peer primary r0
●   mkfs.ext3 /dev/drbd0
●   mount /dev/drbd0 /mnt/data
/etc/drbd.conf
                                         net {
                                           sndbuf-size 512k;
                                           timeout     60; # 6 seconds (unit = 0.1 seconds)
                                           connect-int 10; # 10 seconds (unit = 1 second)
global {
                                           ping-int   10; # 10 seconds (unit = 1 second)
  usage-count no;
                                           ping-timeout 5; # 500 ms (unit = 0.1 seconds)
}
                                           max-buffers 8000;
                                           max-epoch-size 8000;
common {
                                           cram-hmac-alg quot;sha1quot;;
 protocol C;
                                           shared-secret quot;secretquot;;
                                         }
 syncer {
                                     }
   rate 30M;
   al-extents 1801;
                                     resource r0 {
 }
                                      on app1 {
                                        disk    /dev/md2;
 startup {
                                        address 10.10.10.21:7788;
   wfc-timeout 0;
                                        device /dev/drbd0;
   degr-wfc-timeout 15;
                                        meta-disk internal;
 }
                                      }
 disk {
                                         on app2 {
   on-io-error detach;
                                           disk   /dev/sda3;
   # fencing resource-and-stonith;
                                           address 10.10.10.31:7788;
 }
                                           device /dev/drbd0;
                                           meta-disk internal;
                                         }
                                     }
Checking DRBD
 ●   cat /proc/drbd

root@app1:/mnt/data# cat /proc/drbd
version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12 11:56:43
 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
   ns:237740648 nr:7160 dw:19725440 dr:242166751 al:2274 bm:17504 lo:0 pe:0 ua:0 ap:0
      resync: used:0/31 hits:13841287 misses:13628 starving:0 dirty:0 changed:13628
      act_log: used:0/1801 hits:4927296 misses:2427 starving:0 dirty:153 changed:2274
Heartbeat
●   Exchange heartbeats
●   When the heartbeat fails, other begins takeover
●   Use 2 NICs (try to prevent split brain)
●   Uses LSB init scripts
●   Version 1
    –   Simple as cake
●   Version 2
    –   GUI, allows more complex situations
Heartbeat Installation Overview
  ●   Install heartbeat (apt-get install heartbeat)
  ●   3 conf files
                                                          /etc/ha.d/ha.cf
                                                                keepalive 2
/etc/ha.d/haresources                                           deadtime 15
      app1                                                     warntime 5
              IPaddr::192.168.1.211/24/eth0                    initdead 30
              IPaddr::192.168.1.212/24/eth0                    autojoin none
              drbddisk::r0                                     bcast eth1
              Filesystem::/dev/drbd0::/mnt/data::ext3          mcast eth0 239.0.0.42 694 1 0
              bind9                                            auto_failback off
              postfix                                          node app1 app2
              courier-imap                                     logfacility local0
              courier-imap-ssl 
              mysql 
              apache2                                    /etc/ha.d/authkeys
              samba                                             auth 1
                                                                1 sha1 secret
Finalizing Heartbeat Install
●   Stop services
    –   /etc/init.d/apache2 stop
●   Disable services (Ubuntu/Debian)
    –   update-rc.d -f apache2 remove
●   Disable mounting of DRBD drive (/etc/fstab)
    –   /dev/drbd0    /mnt/data    ext3 noauto 0 0
Running Heartbeat
●   /etc/init.d/heartbeat start
●   /usr/lib/heartbeat/hb_takeover
●   /usr/lib/heartbeat/hb_standby
Samba

[global]
      log file = /var/log/samba/log.%m
      passwd chat = *EntersnewsUNIXspassword:*
%nn *RetypesnewsUNIXspassword:* %nn                [data]
*passwd:*passwordsupdatedssuccessfully* .                      writeable = yes
      socket options = TCP_NODELAY                               path = /mnt/data
      obey pam restrictions = yes                                force group = root
      encrypt passwords = true                                   force user = root
      passwd program = /usr/bin/passwd %u                        create mode = 664
      passdb backend = tdbsam                                    directory mode = 775
      dns proxy = no
      server string = %h server (Samba, Ubuntu)         [www]
      invalid users = root                                  force user = www-data
      workgroup = WORKGROUP                                 writeable = yes
      os level = 20                                         create mode = 664
      auto services = data                                  path = /mnt/data/www
      security = user                                       directory mode = 775
      syslog = 0                                            force group = www-data
      panic action = /usr/share/samba/panic-action %d
      max log size = 1000
# guest account = nobody
Split Brain
●   Both servers are primary
●   Which one is up-to-date?
●   How do you prevent split brain?
Stonith
            apt-get install stonith

Shoot
The
Other
Node
In
The
Head
        ●   Home made stonith device
        ●   Connects serial port to other server's reset switch
        ●   ~$40 in Radio Shack parts to build 2 of them
        ●   http://www.scl.co.uk/rcd_serial/README.rcd_serial
MySQL
●   For maximum performance, use RAID 10 with
    battery backed cache RAID controller
●   Write transactions to disk so they get replicated
    –   innodb_flush_log_at_trx_commit=1
    –   sync_binlog=1
●   More info:
    –   http://www.mysqlperformanceblog.com/2008/06/02/how-much-overhead-drdb-could-cause/
Demo
●   Reboot app1
●   App2 become primary
●   App1 comes online, re-syncs
●   Turn off app1's network
●   DRBD on app2 loses connection with app1
●   Run home and enable app1's networking :)
More Info
●   http://www.drbd.org/
●   http://www.cb1inc.com/taxonomy/term/70
Questions?




 Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingMichelle Holley
 
Apache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex HuangApache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex Huangbuildacloud
 
KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeAcademy
 
Neighbor Discovery Deep Dive – IPv6-Networking-Referat
Neighbor Discovery Deep Dive – IPv6-Networking-ReferatNeighbor Discovery Deep Dive – IPv6-Networking-Referat
Neighbor Discovery Deep Dive – IPv6-Networking-ReferatDigicomp Academy AG
 
Nick Fisk - low latency Ceph
Nick Fisk - low latency CephNick Fisk - low latency Ceph
Nick Fisk - low latency CephShapeBlue
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017 Karan Singh
 
Understanding nas (network attached storage)
Understanding nas (network attached storage)Understanding nas (network attached storage)
Understanding nas (network attached storage)sagaroceanic11
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingMichelle Holley
 
Operator Framework Overview
Operator Framework OverviewOperator Framework Overview
Operator Framework OverviewRob Szumski
 
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...Vietnam Open Infrastructure User Group
 
Secrets in Kubernetes
Secrets in KubernetesSecrets in Kubernetes
Secrets in KubernetesJerry Jalava
 
Using the KVMhypervisor in CloudStack
Using the KVMhypervisor in CloudStackUsing the KVMhypervisor in CloudStack
Using the KVMhypervisor in CloudStackShapeBlue
 
Helm - Package Manager for Kubernetes
Helm - Package Manager for KubernetesHelm - Package Manager for Kubernetes
Helm - Package Manager for KubernetesKnoldus Inc.
 
nexus helm 설치, docker/helm repo 설정과 예제
nexus helm 설치, docker/helm repo 설정과 예제nexus helm 설치, docker/helm repo 설정과 예제
nexus helm 설치, docker/helm repo 설정과 예제choi sungwook
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep diveWinton Winton
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver艾鍗科技
 

Was ist angesagt? (20)

DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
 
Apache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex HuangApache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex Huang
 
KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
 
Neighbor Discovery Deep Dive – IPv6-Networking-Referat
Neighbor Discovery Deep Dive – IPv6-Networking-ReferatNeighbor Discovery Deep Dive – IPv6-Networking-Referat
Neighbor Discovery Deep Dive – IPv6-Networking-Referat
 
Nick Fisk - low latency Ceph
Nick Fisk - low latency CephNick Fisk - low latency Ceph
Nick Fisk - low latency Ceph
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017
 
Understanding nas (network attached storage)
Understanding nas (network attached storage)Understanding nas (network attached storage)
Understanding nas (network attached storage)
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
 
Operator Framework Overview
Operator Framework OverviewOperator Framework Overview
Operator Framework Overview
 
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
Room 2 - 3 - Nguyễn Hoài Nam & Nguyễn Việt Hùng - Terraform & Pulumi Comparin...
 
Secrets in Kubernetes
Secrets in KubernetesSecrets in Kubernetes
Secrets in Kubernetes
 
Using the KVMhypervisor in CloudStack
Using the KVMhypervisor in CloudStackUsing the KVMhypervisor in CloudStack
Using the KVMhypervisor in CloudStack
 
Dns
DnsDns
Dns
 
Helm - Package Manager for Kubernetes
Helm - Package Manager for KubernetesHelm - Package Manager for Kubernetes
Helm - Package Manager for Kubernetes
 
nexus helm 설치, docker/helm repo 설정과 예제
nexus helm 설치, docker/helm repo 설정과 예제nexus helm 설치, docker/helm repo 설정과 예제
nexus helm 설치, docker/helm repo 설정과 예제
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
 
Vagrant
Vagrant Vagrant
Vagrant
 

Andere mochten auch

High Availability Server with DRBD in linux
High Availability Server with DRBD in linuxHigh Availability Server with DRBD in linux
High Availability Server with DRBD in linuxAli Rachman
 
High Availability Setup with Heartbeat and Floating IP
High Availability Setup with Heartbeat and Floating IPHigh Availability Setup with Heartbeat and Floating IP
High Availability Setup with Heartbeat and Floating IPayman diab
 
WordPress for Beginners Create Professional Websites
WordPress for Beginners Create Professional WebsitesWordPress for Beginners Create Professional Websites
WordPress for Beginners Create Professional Websitesayman diab
 
brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2Nick Wang
 
Accomplishing redundancy on Lustre based PFS with DRBD
Accomplishing redundancy on Lustre based PFS with DRBDAccomplishing redundancy on Lustre based PFS with DRBD
Accomplishing redundancy on Lustre based PFS with DRBDTyrone Systems
 
What is new in Leap42.2 and SLE12SP2
What is new in Leap42.2 and SLE12SP2What is new in Leap42.2 and SLE12SP2
What is new in Leap42.2 and SLE12SP2Nick Wang
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...Michal Němec
 
Introduction to DRBD
Introduction to DRBDIntroduction to DRBD
Introduction to DRBDdawnlua
 
DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)Jaroslav Jacjuk
 
Alfio Muñoz - Alta disponibilidad con Elastix
Alfio Muñoz - Alta disponibilidad con ElastixAlfio Muñoz - Alta disponibilidad con Elastix
Alfio Muñoz - Alta disponibilidad con ElastixElastixCom
 
Elastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA moduleElastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA moduleHani Perkasa
 
أساسيات لغة Php بالعربي
أساسيات لغة Php بالعربيأساسيات لغة Php بالعربي
أساسيات لغة Php بالعربيtahsal99
 
High Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureHigh Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureSanjay Willie
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on LinuxPawan Kumar
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about cephEmma Haruka Iwao
 
Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)Sage Weil
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
 
Drbd9 and drbdmanage_june_2016
Drbd9 and drbdmanage_june_2016Drbd9 and drbdmanage_june_2016
Drbd9 and drbdmanage_june_2016Philipp Reisner
 
drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015Alexandre Huynh
 

Andere mochten auch (20)

High Availability Server with DRBD in linux
High Availability Server with DRBD in linuxHigh Availability Server with DRBD in linux
High Availability Server with DRBD in linux
 
High Availability Setup with Heartbeat and Floating IP
High Availability Setup with Heartbeat and Floating IPHigh Availability Setup with Heartbeat and Floating IP
High Availability Setup with Heartbeat and Floating IP
 
WordPress for Beginners Create Professional Websites
WordPress for Beginners Create Professional WebsitesWordPress for Beginners Create Professional Websites
WordPress for Beginners Create Professional Websites
 
brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2
 
Accomplishing redundancy on Lustre based PFS with DRBD
Accomplishing redundancy on Lustre based PFS with DRBDAccomplishing redundancy on Lustre based PFS with DRBD
Accomplishing redundancy on Lustre based PFS with DRBD
 
What is new in Leap42.2 and SLE12SP2
What is new in Leap42.2 and SLE12SP2What is new in Leap42.2 and SLE12SP2
What is new in Leap42.2 and SLE12SP2
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
 
Introduction to DRBD
Introduction to DRBDIntroduction to DRBD
Introduction to DRBD
 
DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)
 
Alfio Muñoz - Alta disponibilidad con Elastix
Alfio Muñoz - Alta disponibilidad con ElastixAlfio Muñoz - Alta disponibilidad con Elastix
Alfio Muñoz - Alta disponibilidad con Elastix
 
Elastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA moduleElastix4.0 High Availability without ElastixHA module
Elastix4.0 High Availability without ElastixHA module
 
أساسيات لغة Php بالعربي
أساسيات لغة Php بالعربيأساسيات لغة Php بالعربي
أساسيات لغة Php بالعربي
 
Drbd
DrbdDrbd
Drbd
 
High Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureHigh Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft Azure
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on Linux
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about ceph
 
Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Drbd9 and drbdmanage_june_2016
Drbd9 and drbdmanage_june_2016Drbd9 and drbdmanage_june_2016
Drbd9 and drbdmanage_june_2016
 
drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015
 

Ähnlich wie High Availability With DRBD & Heartbeat

High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-costnormanmaurer
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterAndrey Kudryavtsev
 
Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10Sean Hull
 
10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in productionParis Data Engineers !
 
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...Mydbops
 
Distributed replicated block device
Distributed replicated block deviceDistributed replicated block device
Distributed replicated block deviceChanaka Lasantha
 
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"OpenStack Korea Community
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 
Advanced administration and problem determination
Advanced administration and problem determinationAdvanced administration and problem determination
Advanced administration and problem determinationsolarisyougood
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisAnne Nicolas
 
Linux lv ms step by step
Linux lv ms step by stepLinux lv ms step by step
Linux lv ms step by stepsudakarman
 
import rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythonimport rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythongroveronline
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with GanetiOSCON Byrum
 

Ähnlich wie High Availability With DRBD & Heartbeat (20)

High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-cost
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
 
Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10
 
10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production
 
testing-nfs
testing-nfstesting-nfs
testing-nfs
 
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
 
Web Server Free Bsd
Web Server Free BsdWeb Server Free Bsd
Web Server Free Bsd
 
Multipath
MultipathMultipath
Multipath
 
Distributed replicated block device
Distributed replicated block deviceDistributed replicated block device
Distributed replicated block device
 
Dev ops
Dev opsDev ops
Dev ops
 
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
 
XS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt EnglishXS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt English
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Debug generic process
Debug generic processDebug generic process
Debug generic process
 
Advanced administration and problem determination
Advanced administration and problem determinationAdvanced administration and problem determination
Advanced administration and problem determination
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysis
 
Linux lv ms step by step
Linux lv ms step by stepLinux lv ms step by step
Linux lv ms step by step
 
import rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythonimport rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Python
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with Ganeti
 

Mehr von Chris Barber

Remote IP Power Switches
Remote IP Power SwitchesRemote IP Power Switches
Remote IP Power SwitchesChris Barber
 
Node.js/io.js Native C++ Addons
Node.js/io.js Native C++ AddonsNode.js/io.js Native C++ Addons
Node.js/io.js Native C++ AddonsChris Barber
 
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013Chris Barber
 
Exploring the Titanium CLI - Codestrong 2012
Exploring the Titanium CLI - Codestrong 2012Exploring the Titanium CLI - Codestrong 2012
Exploring the Titanium CLI - Codestrong 2012Chris Barber
 
Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Chris Barber
 
Cassandra - Say Goodbye to the Relational Database (5-6-2010)
Cassandra - Say Goodbye to the Relational Database (5-6-2010)Cassandra - Say Goodbye to the Relational Database (5-6-2010)
Cassandra - Say Goodbye to the Relational Database (5-6-2010)Chris Barber
 
Debugging Dojo Applications (2/10/2010)
Debugging Dojo Applications (2/10/2010)Debugging Dojo Applications (2/10/2010)
Debugging Dojo Applications (2/10/2010)Chris Barber
 
Titanium Powered Desktop & Mobile Apps (11/21/2009)
Titanium Powered Desktop & Mobile Apps (11/21/2009)Titanium Powered Desktop & Mobile Apps (11/21/2009)
Titanium Powered Desktop & Mobile Apps (11/21/2009)Chris Barber
 
Dojo - Javascript's Swiss Army Knife (7/15/2009)
Dojo - Javascript's Swiss Army Knife (7/15/2009)Dojo - Javascript's Swiss Army Knife (7/15/2009)
Dojo - Javascript's Swiss Army Knife (7/15/2009)Chris Barber
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference RecapChris Barber
 
Memcached And MySQL
Memcached And MySQLMemcached And MySQL
Memcached And MySQLChris Barber
 

Mehr von Chris Barber (11)

Remote IP Power Switches
Remote IP Power SwitchesRemote IP Power Switches
Remote IP Power Switches
 
Node.js/io.js Native C++ Addons
Node.js/io.js Native C++ AddonsNode.js/io.js Native C++ Addons
Node.js/io.js Native C++ Addons
 
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
 
Exploring the Titanium CLI - Codestrong 2012
Exploring the Titanium CLI - Codestrong 2012Exploring the Titanium CLI - Codestrong 2012
Exploring the Titanium CLI - Codestrong 2012
 
Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)
 
Cassandra - Say Goodbye to the Relational Database (5-6-2010)
Cassandra - Say Goodbye to the Relational Database (5-6-2010)Cassandra - Say Goodbye to the Relational Database (5-6-2010)
Cassandra - Say Goodbye to the Relational Database (5-6-2010)
 
Debugging Dojo Applications (2/10/2010)
Debugging Dojo Applications (2/10/2010)Debugging Dojo Applications (2/10/2010)
Debugging Dojo Applications (2/10/2010)
 
Titanium Powered Desktop & Mobile Apps (11/21/2009)
Titanium Powered Desktop & Mobile Apps (11/21/2009)Titanium Powered Desktop & Mobile Apps (11/21/2009)
Titanium Powered Desktop & Mobile Apps (11/21/2009)
 
Dojo - Javascript's Swiss Army Knife (7/15/2009)
Dojo - Javascript's Swiss Army Knife (7/15/2009)Dojo - Javascript's Swiss Army Knife (7/15/2009)
Dojo - Javascript's Swiss Army Knife (7/15/2009)
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference Recap
 
Memcached And MySQL
Memcached And MySQLMemcached And MySQL
Memcached And MySQL
 

Kürzlich hochgeladen

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Kürzlich hochgeladen (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

High Availability With DRBD & Heartbeat

  • 1. High Availability with DRBD & Heartbeat Chris Barber http://www.cb1inc.com
  • 2. What is DRBD? ● Distributed Replicated Block Device ● RAID 1 mirror across network ● Realtime replications ● Linux-only kernel module ● 2 nodes – Primary/Secondary ● Single/Dual primary mode ● Open source, free
  • 3. Visual Overview Primary Server Secondary Server Service (MySQL, Apache, etc) Service (MySQL, Apache, etc) File system File system OS OS Buffer cache Buffer cache DRBD DRBD Disk TCP/IP TCP/IP Disk Scheduler Scheduler Disk Driver NIC Driver NIC Driver Disk Driver Network Card Network Card Disk Disk Network Card Network Card Original chart: http://www.drbd.org/users-guide/ch-fundamentals.html
  • 4. Uses ● Database Server( MySQL) ● Web Server (Apache) ● File Server (Samba) ● FTP ● DNS ● Email (Postfix) ● Source Repository (Subversion)
  • 5. My Setup ● App 1 ● App 2 ● AMD Opteron 180 ● AMD Sempron 2800+ 2.4GHz dual-core ● 3GB RAM ● 4GB RAM ● 1 x 250 IDE Hard ● 2 x 250GB SATA Drive Software RAID 1 ● 2 x Gigabit NICs ● 2 x Gigabit NICs
  • 6. My Setup App 1 App 2 File Server
  • 8. Partitions ● 250GB total ● 20GB Operating system (/) ● 4GB swap ● 226GB DRBD (/mnt/data)
  • 9. /mnt/data ● /mnt/data/apache2 – Apache conf, SSL certs, htpasswd ● /mnt/data/mail – Mail directory (Postfix/CourierIMAP) ● /mnt/data/mysql – MySQL conf, database files, binlog ● /mnt/data/svn – Subversion repository ● /mnt/data/www - Websites
  • 10. DRBD Install Overview ● Download source ● Compile driver ● modprobe drbd ● Create /etc/drbd.conf ● Create meta disk - drbdadm create-md r0 ● Bring up device - drbdadm up r0 ● Become primary – drbdadm -- --overwrite-data-of-peer primary r0 ● mkfs.ext3 /dev/drbd0 ● mount /dev/drbd0 /mnt/data
  • 11. /etc/drbd.conf net { sndbuf-size 512k; timeout 60; # 6 seconds (unit = 0.1 seconds) connect-int 10; # 10 seconds (unit = 1 second) global { ping-int 10; # 10 seconds (unit = 1 second) usage-count no; ping-timeout 5; # 500 ms (unit = 0.1 seconds) } max-buffers 8000; max-epoch-size 8000; common { cram-hmac-alg quot;sha1quot;; protocol C; shared-secret quot;secretquot;; } syncer { } rate 30M; al-extents 1801; resource r0 { } on app1 { disk /dev/md2; startup { address 10.10.10.21:7788; wfc-timeout 0; device /dev/drbd0; degr-wfc-timeout 15; meta-disk internal; } } disk { on app2 { on-io-error detach; disk /dev/sda3; # fencing resource-and-stonith; address 10.10.10.31:7788; } device /dev/drbd0; meta-disk internal; } }
  • 12. Checking DRBD ● cat /proc/drbd root@app1:/mnt/data# cat /proc/drbd version: 8.0.11 (api:86/proto:86) GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12 11:56:43 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r--- ns:237740648 nr:7160 dw:19725440 dr:242166751 al:2274 bm:17504 lo:0 pe:0 ua:0 ap:0 resync: used:0/31 hits:13841287 misses:13628 starving:0 dirty:0 changed:13628 act_log: used:0/1801 hits:4927296 misses:2427 starving:0 dirty:153 changed:2274
  • 13. Heartbeat ● Exchange heartbeats ● When the heartbeat fails, other begins takeover ● Use 2 NICs (try to prevent split brain) ● Uses LSB init scripts ● Version 1 – Simple as cake ● Version 2 – GUI, allows more complex situations
  • 14. Heartbeat Installation Overview ● Install heartbeat (apt-get install heartbeat) ● 3 conf files /etc/ha.d/ha.cf keepalive 2 /etc/ha.d/haresources deadtime 15 app1 warntime 5 IPaddr::192.168.1.211/24/eth0 initdead 30 IPaddr::192.168.1.212/24/eth0 autojoin none drbddisk::r0 bcast eth1 Filesystem::/dev/drbd0::/mnt/data::ext3 mcast eth0 239.0.0.42 694 1 0 bind9 auto_failback off postfix node app1 app2 courier-imap logfacility local0 courier-imap-ssl mysql apache2 /etc/ha.d/authkeys samba auth 1 1 sha1 secret
  • 15. Finalizing Heartbeat Install ● Stop services – /etc/init.d/apache2 stop ● Disable services (Ubuntu/Debian) – update-rc.d -f apache2 remove ● Disable mounting of DRBD drive (/etc/fstab) – /dev/drbd0 /mnt/data ext3 noauto 0 0
  • 16. Running Heartbeat ● /etc/init.d/heartbeat start ● /usr/lib/heartbeat/hb_takeover ● /usr/lib/heartbeat/hb_standby
  • 17. Samba [global] log file = /var/log/samba/log.%m passwd chat = *EntersnewsUNIXspassword:* %nn *RetypesnewsUNIXspassword:* %nn [data] *passwd:*passwordsupdatedssuccessfully* . writeable = yes socket options = TCP_NODELAY path = /mnt/data obey pam restrictions = yes force group = root encrypt passwords = true force user = root passwd program = /usr/bin/passwd %u create mode = 664 passdb backend = tdbsam directory mode = 775 dns proxy = no server string = %h server (Samba, Ubuntu) [www] invalid users = root force user = www-data workgroup = WORKGROUP writeable = yes os level = 20 create mode = 664 auto services = data path = /mnt/data/www security = user directory mode = 775 syslog = 0 force group = www-data panic action = /usr/share/samba/panic-action %d max log size = 1000 # guest account = nobody
  • 18. Split Brain ● Both servers are primary ● Which one is up-to-date? ● How do you prevent split brain?
  • 19. Stonith apt-get install stonith Shoot The Other Node In The Head ● Home made stonith device ● Connects serial port to other server's reset switch ● ~$40 in Radio Shack parts to build 2 of them ● http://www.scl.co.uk/rcd_serial/README.rcd_serial
  • 20. MySQL ● For maximum performance, use RAID 10 with battery backed cache RAID controller ● Write transactions to disk so they get replicated – innodb_flush_log_at_trx_commit=1 – sync_binlog=1 ● More info: – http://www.mysqlperformanceblog.com/2008/06/02/how-much-overhead-drdb-could-cause/
  • 21. Demo ● Reboot app1 ● App2 become primary ● App1 comes online, re-syncs ● Turn off app1's network ● DRBD on app2 loses connection with app1 ● Run home and enable app1's networking :)
  • 22. More Info ● http://www.drbd.org/ ● http://www.cb1inc.com/taxonomy/term/70