High Availability with DRBD & Heartbeat. Chris Barber http://www.cb1inc.com



Similar documents
Building Elastix-2.4 High Availability Clusters with DRBD and Heartbeat (using a single NIC)

Open-Xchange Server High Availability

High Availability Low Dollar Clustered Storage

# Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server ; wins support = no

High availability infrastructures for TYPO3 Websites

PRM and DRBD tutorial. Yves Trudeau October 2012

ZCP trunk (build 50384) Zarafa Collaboration Platform. Zarafa HA Manual

High Availability, Replicating, Load Balanced MySQL Databases Oliver Hookins Systems Administrator Network Fixinator Script Hacker All round su

Configure Samba with ACL and Active Directory integration Robert LeBlanc BioAg Computer Support, Brigham Young University

Implementing SAN & NAS with Linux by Mark Manoukian & Roy Koh

Lustre SMB Gateway. Integrating Lustre with Windows

short introduction to linux high availability description of problem and solution possibilities linux tools

Creating a NAS with Ubuntu Server

High Availability and Backup Strategies for the Lustre MDS Server

High Availability Storage

Upgrade to Webtrends Analytics 8.7: Best Practices

Highly Available NFS Storage with DRBD and Pacemaker

High Availability & Disaster Recovery Development Project. Concepts, Design and Implementation

Twin Peaks Software High Availability and Disaster Recovery Solution For Linux Server

P03 Linux on POWER OSS High Availability

USB Functions for Windows 7

Linux Development Environment Description Based on VirtualBox Structure

Multiple Public IPs (virtual service IPs) are supported either to cover multiple network segments or to increase network performance.

Scalable Linux Clusters with LVS

Create a virtual machine at your assigned virtual server. Use the following specs

NATIONAL POPULATION REGISTER (NPR)

Reconfigure the production IP address of the primary node Mount the shared Apache installation directory Start all Apache processes

Navigating the Rescue Mode for Linux

High-Availability User s Guide v2.00

EXPRESSCLUSTER X for Windows Quick Start Guide for Microsoft SQL Server Version 1

GlobalSCAPE DMZ Gateway, v1. User Guide

1. Configuring Apache2 Load Balancer with failover mechanism

Parallels Plesk Automation

HighlyavailableiSCSIstoragewith DRBDandPacemaker

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

Linux Embedded devices with PicoDebian Martin Noha

Release Notes for McAfee(R) VirusScan(R) Enterprise for Linux Version Copyright (C) 2014 McAfee, Inc. All Rights Reserved.

System Admin Module User Guide. Schmooze Com Inc.

Overview: Clustering MySQL with DRBD & Pacemaker

Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch

High Availability with PostgreSQL and Pacemaker

Management, Logging and Troubleshooting

MySQL High Availability Solutions. Lenz Grimmer OpenSQL Camp St. Augustin Germany

Release Notes for Fuel and Fuel Web Version 3.0.1

Linux Software Raid. Aug Mark A. Davis

CDH installation & Application Test Report

INSTALL ZENTYAL SERVER

External Storage 200 Series. User s Manual

DeployStudio Server Quick Install

IceWarp to IceWarp Server Migration

SIOS Protection Suite for Linux: MySQL with Data Replication. Evaluation Guide

760 Veterans Circle, Warminster, PA Technical Proposal. Submitted by: ACT/Technico 760 Veterans Circle Warminster, PA

Ubuntu Sever Administration

Red Hat Linux Administration II Installation, Configuration, Software and Troubleshooting

Aradial Installation Guide

LOCKSS on LINUX. CentOS6 Installation Manual 08/22/2013

Windows Template Creation Guide. How to build your own Windows VM templates for deployment in Cloudturk.

Installation Guide to the Snare Server Installation Guide to the Snare Server

PCIe AHCI-IP Demo Instruction Rev Jul-15

Dual HD Giganet NAS Enclosure User s Manual

Parallels Plesk Automation

Resource Manager Corosync/DRBD HA Installation Guide

Kaspersky Endpoint Security 8 for Linux INSTALLATION GUIDE

Wazza s QuickStart 1. Leopard Server - Install & Configure DNS

Table of Contents Introduction and System Requirements 9 Installing VMware Server 35

PVFS High Availability Clustering using Heartbeat 2.0

3.5 EXTERNAL NETWORK HDD. User s Manual

StarWind iscsi SAN: Configuring Global Deduplication May 2012

IBM Security QRadar SIEM Version High Availability Guide IBM

Tushar Joshi Turtle Networks Ltd

HAOSCAR 2.0: an open source HA-enabling framework for mission critical systems

RingStor User Manual. Version 2.1 Last Update on September 17th, RingStor, Inc. 197 Route 18 South, Ste 3000 East Brunswick, NJ

HTTP-FUSE PS3 Linux: an internet boot framework with kboot

Addonics T E C H N O L O G I E S. NAS Adapter. Model: NASU Key Features

Application Note: Upgrading Interceptor software with FTP server on local PC

Step-by-Step Guide. to configure Open-E DSS V7 Active-Active iscsi Failover on Intel Server Systems R2224GZ4GC4. Software Version: DSS ver. 7.

resource r0 { protocol C; incon-degr-cmd "echo '!DRBD! pri on incon-degr' wall ; sleep 60 ; halt -f";

User s Manual CONTENT. Nano NAS Server for USB storages. 1. Product Information Product Specifications System requirements..

SAP HANA Disaster Recovery with Asynchronous Storage Replication Using Snap Creator and SnapMirror

GL254 - RED HAT ENTERPRISE LINUX SYSTEMS ADMINISTRATION III

System administration basics

High Availability Solutions for MySQL. Lenz Grimmer DrupalCon 2008, Szeged, Hungary

ThinkServer RD550 and RD650 Operating System Installation Guide

Implementing the SUSE Linux Enterprise High Availability Extension on System z

How To Install A Safesync On A Server

This guide specifies the required and supported system elements for the application.

DocuShare Installation Guide

System Compatibility. Enhancements. Security. SonicWALL Security Appliance Release Notes

Installation Documentation for CentOS 6 Linux Operating System

PCI Express SATA / esata 6Gb/s RAID Card User Manual

QuickStart Guide for Managing Computers. Version 9.2

Installing Ubuntu LTS with full disk encryption

LOCKSS on LINUX. Installation Manual and the OpenBSD Transition 02/17/2011

out of this world guide to: POWERFUL DEDICATED SERVERS

High Availability Solutions for the MariaDB and MySQL Database

Transcription:

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 OS OS File system Buffer cache Buffer cache DRBD DRBD Disk Scheduler TCP/IP TCP/IP Disk Scheduler Disk Driver NIC Driver NIC Driver Disk Driver Disk Network Card Network Card 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 AMD Opteron 180 2.4GHz dual-core 4GB RAM 2 x 250GB SATA Software RAID 1 2 x Gigabit NICs App 2 AMD Sempron 2800+ 3GB RAM 1 x 250 IDE Hard Drive 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 global { usage-count no; } common { protocol C; syncer { rate 30M; al-extents 1801; } startup { wfc-timeout 0; degr-wfc-timeout 15; } disk { on-io-error detach; # fencing resource-and-stonith; } net { sndbuf-size 512k; timeout 60; # 6 seconds (unit = 0.1 seconds) connect-int 10; # 10 seconds (unit = 1 second) ping-int 10; # 10 seconds (unit = 1 second) ping-timeout 5; # 500 ms (unit = 0.1 seconds) max-buffers 8000; max-epoch-size 8000; cram-hmac-alg "sha1"; shared-secret "secret"; } } resource r0 { on app1 { disk /dev/md2; address 10.10.10.21:7788; device /dev/drbd0; meta-disk internal; } on app2 { disk /dev/sda3; 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 /etc/ha.d/haresources app1 \ IPaddr::192.168.1.211/24/eth0 \ IPaddr::192.168.1.212/24/eth0 \ drbddisk::r0 \ Filesystem::/dev/drbd0::/mnt/data::ext3 \ bind9 \ postfix \ courier-imap \ courier-imap-ssl \ mysql \ apache2 \ samba keepalive 2 deadtime 15 warntime 5 initdead 30 autojoin none bcast eth1 mcast eth0 239.0.0.42 694 1 0 auto_failback off node app1 app2 logfacility local0 /etc/ha.d/authkeys 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 = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *passwd:*password\supdated\ssuccessfully*. socket options = TCP_NODELAY obey pam restrictions = yes encrypt passwords = true passwd program = /usr/bin/passwd %u passdb backend = tdbsam dns proxy = no server string = %h server (Samba, Ubuntu) invalid users = root workgroup = WORKGROUP os level = 20 auto services = data security = user syslog = 0 panic action = /usr/share/samba/panic-action %d max log size = 1000 # guest account = nobody [data] writeable = yes path = /mnt/data force group = root force user = root create mode = 664 directory mode = 775 [www] force user = www-data writeable = yes create mode = 664 path = /mnt/data/www directory mode = 775 force group = www-data

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!