MySQL/MariaDB Multi-Master Replication & Failover



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

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

Zero Downtime Deployments with Database Migrations. Bob Feldbauer

HAProxy. Ryan O'Hara Principal Software Engineer, Red Hat September 17, HAProxy

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

High Availability Solutions for the MariaDB and MySQL Database

Scaling DBMail with MySQL

MySQL Fabric: High Availability Solution for Connector/Python

Upgrading a Single Node Cisco UCS Director Express, page 2. Supported Upgrade Paths to Cisco UCS Director Express for Big Data, Release 2.

High Availability Cluster Solutions for Ubuntu14.04 on Power

High Availability Using MySQL in the Cloud:

Configuring HAproxy as a SwiftStack Load Balancer

CDH installation & Application Test Report

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

Tushar Joshi Turtle Networks Ltd

High Availability and Clustering

INUVIKA TECHNICAL GUIDE

Setting up High Availability

MySQL synchronous replication in practice with Galera

NetSpective Global Proxy Configuration Guide

Juniper Networks Secure Access. Initial Configuration User Records Synchronization

Designing a Data Solution with Microsoft SQL Server 2014

Lab 5 Explicit Proxy Performance, Load Balancing & Redundancy

Step-by-Step Guide to Open-E DSS V7 Active-Active Load Balanced iscsi HA Cluster

How To Monitor Mysql With Zabbix

Jive and High-Availability

Secure Messaging Server Console... 2

Nagios in High Availability Environments

Linux High Availability

GRAVITYZONE HERE. Deployment Guide VLE Environment

MySQL always-up with Galera Cluster

AWS Schema Conversion Tool. User Guide Version 1.0

HA Configuration Approach

Configuring Network Load Balancing with Cerberus FTP Server

Hyper-V backup implementation guide

CS312 Solutions #6. March 13, 2015

Native SSL support was implemented in HAProxy 1.5.x, which was released as a stable version in June 2014.

AlienVault Unified Security Management (USM) x. Configuring High Availability (HA)

ClusterLoad ESX Virtual Appliance quick start guide v6.3

How To Set Up A Two Node Hyperv Cluster With Failover Clustering And Cluster Shared Volume (Csv) Enabled

Penetration Testing LAB Setup Guide

Configuring a VEEAM off host backup proxy server for backing up a Windows Server 2012 R2 Hyper-V cluster with a DELL Compellent SAN (Fiber Channel)

WhatsUp Gold v16.3 Installation and Configuration Guide

Deployment Topologies

Setting Up Specify to use a Shared Workstation as a Database Server

How to integrate RSA ACE Server SecurID Authentication with Juniper Networks Secure Access SSL VPN (SA) with Single Node or Cluster (A/A or A/P)

Configure AlwaysOn Failover Cluster Instances (SQL Server) using InfoSphere Data Replication Change Data Capture (CDC) on Windows Server 2012

Installation documentation for Ulteo Open Virtual Desktop

Hadoop Data Warehouse Manual

Ulteo Open Virtual Desktop Installation

Configuring High Availability for Embedded NGX Gateways in SmartCenter

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

Junos Space. Virtual Appliance Deployment and Configuration Guide. Release 14.1R2. Modified: Revision 2

Database Replication with MySQL and PostgreSQL

Comparing MySQL and Postgres 9.0 Replication

Snapt Redundancy Manual

Building a Microsoft SQL Server Failover Cluster on the Interoute Virtual Data Centre

ICINGA2 OPEN SOURCE MONITORING

High Availability And Disaster Recovery

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

1. Introduction 2. Getting Started 3. Scenario 1 - Non-Replicated Cluster 4. Scenario 2 - Replicated Cluster 5. Conclusion

This How To guide will take you through configuring Network Load Balancing and deploying MOSS 2007 in SharePoint Farm.

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

High Availability CAS

Managing Identities and Admin Access

Preparing for the Big Oops! Disaster Recovery Sites for MySQL. Robert Hodges, CEO, Continuent MySQL Conference 2011

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

AWS Schema Conversion Tool. User Guide Version 1.0

Release Notes for Fuel and Fuel Web Version 3.0.1

Clustering ExtremeZ-IP 4.1

Jive and High-Availability

Step-by-Step Guide to Open-E DSS V7 Active-Active iscsi Failover

Load Balancing McAfee Web Gateway. Deployment Guide

Configuring the Redundancy Feature in a Spectralink IP-DECT Server 6500

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

PrivateWire Gateway Load Balancing and High Availability using Microsoft SQL Server Replication

You need to recommend a monitoring solution to ensure that an administrator can review the availability information of Service1. What should you do?

OS Installation: CentOS 5.8

Hyper-V Replica Broker Configuration Lab By Yung Chou, Microsoft Platform Evangelist,

Understanding IBM Tivoli Monitoring 6.1 Agents In A Microsoft Clustered Environment 06/01/2006

ABRAHAM ARCHITECTURE OF A CLOUD SERVICE USING PYTHON TECHNOLOGIES

High Availability and Scalability for Online Applications with MySQL

Rails Application Deployment. July Philly on Rails

Guideline for setting up a functional VPN

Load Balancing Trend Micro InterScan Web Gateway

CA ARCserve and CA XOsoft r12.5 Best Practices for protecting Microsoft Exchange

Configuring the Redundancy Feature in a KIRK Wireless Server Application Note

HOW TO: Live Migrate VMware Virtual Machines between ESX/ESXi hosts and/or datastores for FREE without licenses for vmotion or St...

Panorama High Availability

Oracle EXAM - 1Z Oracle Weblogic Server 11g: System Administration I. Buy Full Product.

Configuring the Redundancy Feature in a Polycom KIRK Wireless Server 6000

VMware Site Recovery Manager (SRM) Lessons Learned in the First 90 Days

Load Balancing Web Proxies Load Balancing Web Filters Load Balancing Web Gateways. Deployment Guide

How to evaluate which MySQL High Availability solution best suits you

Building a Scale-Out SQL Server 2008 Reporting Services Farm

Citrix NetScaler 10 Essentials and Networking

How To Protect Your Data From Being Damaged On Vsphere Vdp Vdpa Vdpo Vdprod (Vmware) Vsphera Vdpower Vdpl (Vmos) Vdper (Vmom

A SURVEY OF POPULAR CLUSTERING TECHNOLOGIES

Transcription:

MySQL/MariaDB Multi-Master Replication & Failover A HA Solution using MMM and MySQL/MariaDB Arjen Lentz & Walter Heck arjen@openquery.com walter@openquery.com 1 2

Overview Prepare virtual machines this presentation explains MMM Configure MariaDB/MySQL setup replication / my.cnf Install and configure MMM Test out scenarios 3 Introduction What is MMM? HA solution for near immediate failover Automatic failover for slaves to another host What is MMM not? Load balancer 100% Data Reliability (Replication is not perfect!) 4

How MMM works 5 How MMM works 6

How MMM works 7 How MMM works 8

How MMM works 9 Virtual IP Voodoo Exclusive role One virtual IP for multiple machines machine goes down?! ip is moved to another machine Usually used for writemostly nodes (e.g. masters) Balanced role One virtual IP for each machine machine goes down?! ip is moved to another machine Usually used for read-only nodes (e.g. slaves) Caution! Nothing to do with load balancing! One machine can have multiple virtual IPs 10

MMM 2.2.X Actively developed current development done by Pascal Hoffman Complete rewrite from MMM 1.x much more proper perl Uses highly customisable Log4Perl Built-in angel processes Passive mode Preferred roles 11 MMM 2.2.X checks Checks allow mmm_mon to monitor health of the cluster 4 default checks included Ping! server reachable? rep_backlog! replication behind? rep_threads! replication running Mysql! mysql server reachable 12

MMM 2.2.X Agent states (1) ONLINE All is peachy, only state in which a node can have a role assigned REPLICATION_DELAY replication backlog is too big (Check rep_backlog failed) REPLICATION_FAIL replication threads are not running (Check rep_threads and rep_backlog failed) AWAITING_RECOVERY Host is awaiting recovery. Entered after HARD_OFFLINE! all is ok 13 MMM 2.2.X Agent states (2) HARD_OFFLINE Host is offline (Check ping and/or mysql failed) ADMIN_OFFLINE host was set to offline manually UNKNOWN Host is in unknown state 14

Typical MMM 2.2.X 'hardware'/network requirements 5 (virtual) machines Monitor! very lightweight Data nodes! your choice When using VM's: distribute properly, clone smartly! Static IP for each machine 3 virtual IP's 1 for master 2 for slaves 15 Tutorial: Setting up MMM @ MySQLConf2K10 16

Tutorial: Setting up MMM using Ubuntu 9.10 VM specifically prepared for this session already has mariadb 5.1.44 installed has all prerequisites installed follow instructions to change IP and hostname 17 MMM 2.2.X MySQL/MariaDB Minimal settings for all data nodes: enable log-bin set unique server-id Settings for masters: enable log-slave-updates 18

MMM 2.2.X MySQL/MariaDB Replication Set up MySQL/MariaDB replication Make master-2, slave-1 and slave-2 slaves of master-1 Make master-1 slave of master-2 Start slaves and check if everything works properly If all == ok, start loading data into master1 and watch it replicate through the whole cluster There s a file with 1 million records in it in ~/1000000.csv 19 MMM 2.2.X - sample config active_master_role <host default> cluster_interface pid_path bin_path replication_user replication_password agent_user agent_password </host> writer eth0 /var/run/mmm_agentd.pid /usr/local/mysql-mmm/bin replication openquery mmm_agent openquery <host slave-1> ip 192.168.2.208 mode slave </host> <role writer> hosts master-1, master-2 ips 192.168.2.201 mode exclusive </role> <host master-1> ip 192.168.2.206 mode master peer master-2 </host> <role reader> hosts slave-1, slave-2 ips 192.168.2.202, 192.168.2.203 mode balanced </role> === this master-1 20

MMM 2.2.X mmm_control mmm_control is used to control the cluster Needs root privileges because of reading config files 21 MMM 2.2.X common operations Move masters so you can do maintenance mmm_control move_role writer my-master-1 Set a slave offline for maintenance mmm_control set_offline my-slave-1 mmm_control set_online my-slave-1 Put MMM in passive state so it doesn't interfere mmm_control set_passive/set_active Check the status of all checks - mmm_control checks 22

MMM 2.2.X cluster state 'mmm_control show' shows the current state of all agents [openquery@mmm2-monitor ~]$ sudo mmm_control show master-1(192.168.2.206) master/online. Roles: writer(192.168.2.201) master-2(192.168.2.207) master/online. Roles: slave-1(192.168.2.208) slave/online. Roles: reader(192.168.2.202) slave-2(192.168.2.209) slave/online. Roles: reader(192.168.2.203) 'mmm_control mode' shows whether the cluster is active or passive 23 Optional Extras Make configuration go through puppet Makes adding new slaves extremely easy Install MySQL/MariaDB/MMM monitoring Open Query uses Zabbix: lp:ourdelta-zabbix-scripts Preferred hosts When using LVM for MySQL/MariaDB, use MMM tools to clone/backup nodes Use SSL for MMM connections Mix and match solutions! Use HW loadbalancer for reads cron-jobs with mk-table-checksum / mk-table-sync Make sure schema is suitable 24

Ideas for improvement of MMM 2.2.X Add 'real' loadbalancer haproxy MySQL Proxy? Remove monitor as a SPoF Keepalived, Heartbeat Proper packaging Has just been added to Fedora 11&12 / EPEL 25 Credits / Links http://mysql-mmm.org http://ourdelta.org http://openquery.com http://www.zabbix.com Thank you! Arjen Lentz & Walter Heck arjen@openquery.com / walter@openquery.com 26