Overview: Clustering MySQL with DRBD & Pacemaker



Similar documents
PRM and DRBD tutorial. Yves Trudeau October 2012

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

Agenda Zabawę 2 czas zacząć Co to jest corosync? Co to jest pacemaker? Zastosowania Podsumowanie

Pacemaker. A Scalable Cluster Resource Manager for Highly Available Services. Owen Le Blanc. I T Services University of Manchester

OpenLDAP in High Availability Environments

Highly Available NFS Storage with DRBD and Pacemaker

Resource Manager Corosync/DRBD HA Installation Guide

SAP HANA System Replication on SUSE Linux Enterprise Server for SAP Applications

SAP HANA System Replication on SLES for SAP Applications. 11 SP3

HighlyavailableiSCSIstoragewith DRBDandPacemaker

High Availability Low Dollar Clustered Storage

Red Hat Enterprise Linux 7 High Availability Add-On Administration. Configuring and Managing the High Availability Add-On

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

Open Source High Availability Writing Resource Agents for your own services. Lars Marowsky-Brée Team Lead SUSE Labs

Building a High-Availability PostgreSQL Cluster

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

SteelEye Protection Suite for Linux: Apache/MySQL. Evaluation Guide

High Availability with PostgreSQL and Pacemaker

High Availability Solutions for the MariaDB and MySQL Database

PVFS High Availability Clustering using Heartbeat 2.0

CRM CLI (command line interface) tool

Implementing the SUSE Linux Enterprise High Availability Extension on System z

Parallels Virtuozzo Containers 4.7 for Linux

Zen and The Art of High-Availability Clustering Lars Marowsky-Brée

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

HIGH AVAILABILITY (HA) WITH OPENSIPS

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

High Availability Solutions with MySQL

Architectures Haute-Dispo Joffrey MICHAÏE Consultant MySQL

High Availability and Backup Strategies for the Lustre MDS Server

High Availability Storage

Zenoss Core Installation and Upgrade

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

Cloud Homework instructions for AWS default instance (Red Hat based)

Pacemaker Remote. Scaling High Availablity Clusters. David Vossel

How To Install Storegrid Server On Linux On A Microsoft Ubuntu 7.5 (Amd64) Or Ubuntu (Amd86) (Amd77) (Orchestra) (For Ubuntu) (Permanent) (Powerpoint

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

Highly Available NFS Storage with DRBD and Pacemaker

Best Current Practices for SUSE Linux Enterprise High Availability 12

stub (Private Switch) Solaris 11 Operating Environment In the Solaris 11 Operating Environment, four zones are created namely:

Acronis Backup & Recovery 10 Server for Linux. Installation Guide

Configuring Offboard Storage Guide

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Linux System Administration on Red Hat

CentOS Cluster Server. Ryan Matteson

Moving to Plesk Automation 11.5

The Linux System. o Updating without touching the user's files and configurations.

Parallels Virtuozzo Containers 4.7 for Linux Readme

SkySQL Data Suite. A New Open Source Approach to MySQL Distributed Systems. Serge Frezefond V

Zend Server 5.0 Reference Manual

CN=Monitor Installation and Configuration v2.0

High Availability with DRBD & Heartbeat. Chris Barber

High availability infrastructures for TYPO3 Websites

System administration basics

Parallels Plesk Automation

SUSE Linux Enterprise High Availability Extension. Piotr Szewczuk konsultant

Acronis Backup & Recovery 10 Server for Linux. Update 5. Installation Guide

High-Availability Using Open Source Software

Quick start guide for data backup: Backup Archive Client installation for Linux

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

Amazon EC 2 Cloud Deployment Guide

INUVIKA TECHNICAL GUIDE

Easy Setup Guide 1&1 CLOUD SERVER. Creating Backups. for Linux

Backing Up Your System With rsnapshot

Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

INUVIKA OVD INSTALLING INUVIKA OVD ON RHEL 6

Information Systems Application Administration Manual Request Tracker

Installing and Configuring MySQL as StoreGrid Backend Database on Linux

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

Scalable Linux Clusters with LVS

SUSE Linux Enterprise Server

Installation and Control in Linux

Upgrading Cisco UCS Central

INF-110. GPFS Installation

Kaspersky Endpoint Security 8 for Linux INSTALLATION GUIDE

Clusters from Scratch - Apache, DRBD and GFS2

Acronis Backup & Recovery 10 Server for Linux. Quick Start Guide

Understanding MySQL storage and clustering in QueueMetrics. Loway

Installation and Control in Linux

User and Reference Manual

Installation Guide. Copyright (c) 2015 The OpenNMS Group, Inc. OpenNMS SNAPSHOT Last updated :19:20 EDT

JAMF Software Server Installation and Configuration Guide for Linux. Version 9.2

Installing Virtual Coordinator (VC) in Linux Systems that use RPM (Red Hat, Fedora, CentOS) Document # 15807A1-103 Date: Aug 06, 2012

Administration Guide. SUSE Linux Enterprise High Availability Extension 12 SP1

MySQL and Virtualization Guide

Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4


ULTEO OPEN VIRTUAL DESKTOP V4.0

Implementing the SUSE Linux Enterprise High Availability Extension on System z Mike Friesenegger

ZCP trunk (build 51762) Z-Admin Manual. The Z-Admin Manual

PARALLELS SERVER 4 BARE METAL README

How to Restore a Linux Server Using Bare Metal Restore

JAMF Software Server Installation and Configuration Guide for OS X. Version 9.0

QuickBooks Enterprise Solutions. Linux Database Server Manager Installation and Configuration Guide

Server Monitoring. AppDynamics Pro Documentation. Version Page 1

Release Notes for Fuel and Fuel Web Version 3.0.1

IMPLEMENTATION GUIDE DECEMBER HGST Flash Pools Implementation Guide for MySQL Database

MySQL Fabric: High Availability Solution for Connector/Python

How To Install Acronis Backup & Recovery 11.5 On A Linux Computer

Transcription:

Overview: Clustering MySQL with DRBD & Pacemaker Trent Lloyd <trent.lloyd@oracle.com> 1

Overview Software Packages (OpenAIS, Pacemaker/CRM, DRBD) Concepts Setup & configuration Installing packages Configure OpenAIS Configure DRBD Configure MySQL Configuring Pacemaker CRM Confirm Cluster Status Basic Troubleshooting Questions & Discussion Live Demo 2

Software Packages OpenAIS ( Cluster manager ) - replaces ha.cf Manages the discovery of nodes, their status and transmission of cluster state information between them. Heartbeat 3.0 is also available, but it is deprecated in favour of OpenAIS. Pacemaker ( Resource Manager ) - replaces haresources Communicates over OpenAIS to co-ordinate the starting, stopping and migration of resources between nodes. Also deals with policy decisions such as where to place a resource, what order they should be started in and if they should run on the same node. DRBD Network-based disk replication, creates a shared disk between 2 nodes that is also copied to both nodes, for purposes of redundancy. MySQL 3

CC-BY-SA Source: http://www.clusterlabs.org/doc/en-us/pacemaker/1.0/html/pacemaker_explained/s-intro-redundancy.html 4

Setup & Configuration - Packages RHEL 5 / CentOS 5 RPM http://www.clusterlabs.org/wiki/install#installing_on_epel_compatible_distributions:_rhel.2c_centos.2c_etc rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/ epel-release-5-3.noarch.rpm wget -O /etc/yum.repos.d/pacemaker.repo http://clusterlabs.org/ rpm/epel-5/clusterlabs.repo yum install -y pacemaker corosync drbd83 kmod-drbd83 drbdpacemaker drbd-utils MySQL RPM download from website MySQL-server, MySQL-shared, MySQL-client rpm -Uvh MySQL-* 5

Setup & Configuration - Alternate Packages Clusterlabs Sources: RPM: Fedora, OpenSuse, CentoS, RHEL5, etc DEB: Debian, Ubuntu Mac OS X / Darwin Source http://www.clusterlabs.org/wiki/install 6

Setup & Configuration - Startup Changes Disable cluster-managed services from startup chkconfig --del heartbeat chkconfig --del drbd chkconfig --del mysql Disable firewall 7

Setup & Configuration - OpenAIS Ensure the firewall is disabled Configure /etc/corosync/corosync.conf totem { logging { version: 2 token: 3000 token_retransmits_before_loss_const: 10 join: 60 consensus: 1500 vsftype: none to_stderr: yes debug: on timestamp: on to_file: no to_syslog: yes syslog_facility: daemon max_messages: 20 clear_node_high_bit: yes secauth: on threads: 0 rrp_mode: passive service { ver: 0 name: pacemaker interface { use_mgmtd: yes ringnumber: 0 bindnetaddr: 10.0.1.0 mcastaddr: 239.94.1.1 mcastport: 5405 aisexec { user: root group: root 8

Setup & Configuration - OpenAIS Ensure the firewall is disabled Configure /etc/corosync/corosync.conf totem { logging { version: 2 token: 3000 token_retransmits_before_loss_const: 10 join: 60 consensus: 1500 vsftype: none max_messages: 20 clear_node_high_bit: yes secauth: on threads: 0 interface { ringnumber: 0 to_stderr: yes debug: on timestamp: on to_file: no bindnetaddr: 10.0.1.0 to_syslog: yes mcastaddr: 239.94.1.1 mcastport: 5405 syslog_facility: daemon service { ver: 0 rrp_mode: passive name: pacemaker interface { use_mgmtd: yes ringnumber: 0 bindnetaddr: 10.0.1.0 mcastaddr: 239.94.1.1 mcastport: 5405 aisexec { user: root group: root 8

Setup & Configuration - OpenAIS Ensure the firewall is disabled Configure /etc/corosync/corosync.conf totem { logging { version: 2 token: 3000 token_retransmits_before_loss_const: 10 join: 60 consensus: 1500 vsftype: none max_messages: 20 clear_node_high_bit: yes secauth: on threads: 0 interface { ringnumber: 0 to_stderr: yes debug: on timestamp: on to_file: no bindnetaddr: 10.0.1.0 to_syslog: yes mcastaddr: 239.94.1.1 mcastport: 5405 syslog_facility: daemon service { ver: 0 rrp_mode: passive name: pacemaker interface { ringnumber: 0 bindnetaddr: 10.0.1.0 mcastaddr: 239.94.1.1 mcastport: 5405 use_mgmtd: yes This is the -network- address, i.e. if your IP is 10.0.1.1 and netmask 255.255.255.0 (/24) - aisexec { network is 10.0.1.0 - first address user: root group: root 8

Setup & Configuration - DRBD Before starting corosync for the first time, you must get DRBD ready Create drbd.conf Note in these examples, I expect the resource to be named mysql and not r0 or other /etc/init.d/drbd start drbdadm -- --overwrite-data-of-peer primary mysql mkfs.ext3 /dev/drbd/by-res/mysql 9

Setup & Configuration - Configure MySQL rm -rf /var/lib/mysql/* # Remove installed version mount /dev/drbd/by-res/mysql /var/lib/mysql /etc/my.cnf mysql_install_db --user=mysql # or restore backup restorecon -R /var/lib/mysql/ umount /var/lib/mysql drbdadm secondary mysql 10

Setup & Configuration - Status All nodes: /etc/init.d/corosync start crm_mon ============ Last updated: Wed Apr 21 05:23:00 2010 Stack: openais Current DC: pacemaker1 - partition with quorum Version: 1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7 2 Nodes configured, 2 expected votes 2 Resources configured. ============ Online: [ pacemaker1 pacemaker2 ] 11

Setup & Configuration - Configure Pacemaker CRM Configuration root@pacemaker1# crm crm(live)# configure crm(live)configure# primitive drbd_mysql ocf:linbit:drbd \ params drbd_resource="mysql" \ op monitor interval="15s" crm(live)configure# ms ms_drbd_mysql drbd_mysql \ meta master-max="1" master-node-max="1" \ clone-max="2" clone-node-max="1" \ notify="true" crm(live)configure# primitive fs_mysql ocf:heartbeat:filesystem \ params device="/dev/drbd/by-res/mysql" directory="/var/lib/mysql" fstype="ext3" crm(live)configure# primitive ip_mysql ocf:heartbeat:ipaddr2 \ params ip="10.9.42.1" nic="eth0" crm(live)configure# primitive mysqld lsb:mysqld crm(live)configure# group mysql fs_mysql ip_mysql mysqld crm(live)configure# colocation mysql_on_drbd inf: mysql ms_drbd_mysql:master crm(live)configure# order mysql_after_drbd inf: ms_drbd_mysql:promote mysql:start crm(live)configure# commit crm(live)configure# exit 12

Setup & Configuration - Configure Pacemaker CRM - Primitives Replaces MON crm(live)configure# primitive drbd_mysql ocf:linbit:drbd \ params drbd_resource="mysql" \ op monitor interval="15s" crm(live)configure# primitive fs_mysql ocf:heartbeat:filesystem \ params device="/dev/drbd/by-res/mysql" directory="/var/lib/mysql" fstype="ext3" crm(live)configure# primitive ip_mysql ocf:heartbeat:ipaddr2 \ params ip="10.1.0.254" nic="eth0" crm(live)configure# primitive mysqld lsb:mysqld primitive command creates a resource Uses either OCF or standard /etc/init.d (lsb) scripts A list of OCF handlers can be found in /usr/lib/ocf Beware of init.d scripts that are not truly LSB compliant 13

Setup & Configuration - Configure Pacemaker CRM - Master Slave id rsc crm(live)configure# ms ms_drbd_mysql drbd_mysql \ meta master-max="1" master-node-max="1" \ clone-max="2" clone-node-max="1" \ notify="true" options - specifies 2 node, 1 master - 1 slave ms makes a resource into a Master-Slave setup This means it is active on both nodes at once One node is a master, one node is a slave, roles switch Alternative to simply started or stopped with normal resource 14

Setup & Configuration - Configure Pacemaker CRM - Groups crm(live)configure# group mysql fs_mysql ip_mysql mysqld id rsc1 rsc2 rsc3... group creates a group mysql which sub-resources Groups can be started and stopped as a whole, and used in other directives such for co-location and order 15

Setup & Configuration - Configure Pacemaker CRM - Co-location Constraints crm(live)configure# colocation mysql_on_drbd inf: mysql ms_drbd_mysql:master id score rsc with-rsc Co-location is a constraint that says resources A and B must run on the same server at the same time Example: MySQL Server depends on the shared MySQL filesystem running on the same server 16

Setup & Configuration - Configure Pacemaker CRM - Order Constraints crm(live)configure# order mysql_after_drbd inf: ms_drbd_mysql:promote mysql:start id score first:action then:action order defines an order in which resources must be started Example: MySQL group cannot start until DRBD has become Master 17

Setup & Configuration - Configure Pacemaker CRM Configuration root@pacemaker1# crm crm(live)# configure crm(live)configure# primitive drbd_mysql ocf:linbit:drbd \ params drbd_resource="mysql" \ op monitor interval="15s" crm(live)configure# ms ms_drbd_mysql drbd_mysql \ meta master-max="1" master-node-max="1" \ clone-max="2" clone-node-max="1" \ notify="true" crm(live)configure# primitive fs_mysql ocf:heartbeat:filesystem \ params device="/dev/drbd/by-res/mysql" directory="/var/lib/mysql" fstype="ext3" crm(live)configure# primitive ip_mysql ocf:heartbeat:ipaddr2 \ params ip="10.1.0.254" nic="eth0" crm(live)configure# primitive mysqld lsb:mysqld crm(live)configure# group mysql fs_mysql ip_mysql mysqld crm(live)configure# colocation mysql_on_drbd inf: mysql ms_drbd_mysql:master crm(live)configure# order mysql_after_drbd inf: ms_drbd_mysql:promote mysql:start crm(live)configure# commit crm(live)configure# exit 18

crm_mon Setup & Configuration - Status ============ Last updated: Wed Apr 21 05:23:00 2010 Stack: openais Current DC: pacemaker1 - partition with quorum Version: 1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7 2 Nodes configured, 2 expected votes 2 Resources configured. ============ Online: [ pacemaker1 pacemaker2 ] Master/Slave Set: ms_drbd_mysql Masters: [ pacemaker1 ] Slaves: [ pacemaker2 ] Resource Group: mysql fs_mysql (ocf::heartbeat:filesystem): Started pacemaker1 ip_mysql (ocf::heartbeat:ipaddr2): Started pacemaker1 mysqld (lsb:mysql): Started pacemaker1 19

Setup & Configuration - Troubleshooting crm_mon mysqld (lsb:mysql): Started pacemaker1 (unmanaged) FAILED Failed actions: mysqld_stop_0 (node=pacemaker1, call=86, rc=1, status=complete): unknown error Fix problems Check /var/log/messages crm(live)# resource cleanup mysqld Other actions crm(live)# resource stop mysqld crm(live)# resource start mysqld crm(live)# configure show 20

Resources DRBD User s Guide http://www.drbd.org/docs/applications/ Cluster Labs (Pacemaker) http://www.clusterlabs.org/ 21

END OF PREPARED PRESENTATION QUESTIONS & DISCUSSION 22

Overview: Clustering MySQL with DRBD & Pacemaker Trent Lloyd <trent.lloyd@oracle.com> 23