MySQL always-up with Galera Cluster



Similar documents
High-availability with Galera Cluster for MySQL

MySQL synchronous replication in practice with Galera

Synchronous multi-master clusters with MySQL: an introduction to Galera

Galera Replication. Synchronous Multi-Master Replication for InnoDB. ...well, why not for any other DBMS as well. Seppo Jaakola Alexey Yurchenko

High Availability Solutions for the MariaDB and MySQL Database

How To Monitor Mysql With Zabbix

MySQL Administration and Management Essentials

DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems Santa Clara, April 12, 2010

Percona Server features for OpenStack and Trove Ops


MySQL High-Availability and Scale-Out architectures

Monitoring Galera with MONyog

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

MySQL backups: strategy, tools, recovery scenarios. Akshay Suryawanshi Roman Vynar

Top 10 Reasons why MySQL Experts Switch to SchoonerSQL - Solving the common problems users face with MySQL

High Availability Using MySQL in the Cloud:

MySQL Replication. openark.org

High Availability and Scalability for Online Applications with MySQL

MySQL Cluster Deployment Best Practices

How to evaluate which MySQL High Availability solution best suits you

Tushar Joshi Turtle Networks Ltd

Zero-Downtime MySQL Backups

Solving Large-Scale Database Administration with Tungsten

5 Percona Toolkit tools that could save your day. Stéphane Combaudon FOSDEM February 3rd, 2013

Adding Indirection Enhances Functionality

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

Who did what, when, where and how MySQL Audit Logging. Jeremy Glick & Andrew Moore 20/10/14

MySQL Backup IEDR

MySQL Backup and Security. Best practices on how to run MySQL on Linux in a secure way Lenz Grimmer <lenz@mysql.com>

MySQL performance in a cloud. Mark Callaghan

Andrew Moore Amsterdam 2015

Load balancing MySQL with HaProxy. Peter Boros Percona 4/23/13 Santa Clara, CA

MySQL Enterprise Backup

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

F1: A Distributed SQL Database That Scales. Presentation by: Alex Degtiar (adegtiar@cmu.edu) /21/2013

Table of Contents. Overview... 1 Introduction... 2 Common Architectures Technical Challenges with Magento ChinaNetCloud's Experience...

SQL Server Training Course Content

MySQL és Hadoop mint Big Data platform (SQL + NoSQL = MySQL Cluster?!)

MySQL/MariaDB Multi-Master Replication & Failover

XtraBackup: Hot Backups and More

XtraBackup. Vadim Tkachenko CTO, Co-Founder, Percona Inc Percona Live SF Feb 2011

Björn Kraus. Session Aware Full Page Caching For Magento With Varnish ESI

Zero Downtime Deployments with Database Migrations. Bob Feldbauer

Deploying BDR. Simon Riggs CTO, 2ndQuadrant & Major Developer, PostgreSQL. February 2015

Not Your Grandpa s Replication

MySQL backup and restore best practices. Roman Vynar September 21, 2015

Switch to MySQLnd Already!

SharePoint 2013 Best Practices

VMware Continuent. Benefits and Configurations TECHNICAL WHITE PAPER

Portable Scale-Out Benchmarks for MySQL. MySQL User Conference 2008 Robert Hodges CTO Continuent, Inc.

Berkeley Ninja Architecture

Database Administration with MySQL

Lenz Grimmer

Cost effective methods of test environment management. Prabhu Meruga Director - Solution Engineering 16 th July SCQAA Irvine, CA

Dave Stokes MySQL Community Manager

Availability Digest. MySQL Clusters Go Active/Active. December 2006

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

Cloud Based Application Architectures using Smart Computing

Module 14: Scalability and High Availability

White Paper. Optimizing the Performance Of MySQL Cluster

How to choose High Availability solutions for MySQL MySQL UC 2010 Yves Trudeau Read by Peter Zaitsev. Percona Inc MySQLPerformanceBlog.

Guerrilla Warfare? Guerrilla Tactics - Performance Testing MS SQL Server Applications

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

Part 3. MySQL DBA I Exam

Database Scalability {Patterns} / Robert Treat

Real-time reporting at 10,000 inserts per second. Wesley Biggs CTO 25 October 2011 Percona Live

Mind Q Systems Private Limited

Future-Proofing MySQL for the Worldwide Data Revolution

Mark Bennett. Search and the Virtual Machine

insync Installation Guide

Online Backup Client User Manual

vtiger CRM Database UTF-8 Configuration (For MySQL)

MySQL Backup and Recovery: Tools and Techniques. Presented by: René Senior Operational DBA

Contents. SnapComms Data Protection Recommendations

Leveraging the Cloud. September 22, Digital Government Institute Cloud-Enabled Government Conference Washington, DC

<Insert Picture Here> MySQL Security In A Cloudy World

Server Software Installation Guide

Overview of Databases On MacOS. Karl Kuehn Automation Engineer RethinkDB

IP Office Technical Tip

Integrated Application and Data Protection. NEC ExpressCluster White Paper

Welcome to Virtual Developer Day MySQL!

MySQL Fabric: High Availability Solution for Connector/Python

Comparing MySQL and Postgres 9.0 Replication

Cloud DBMS: An Overview. Shan-Hung Wu, NetDB CS, NTHU Spring, 2015

Release Notes for Fuel and Fuel Web Version 3.0.1

Astaro Deployment Guide High Availability Options Clustering and Hot Standby

Techniques for implementing & running robust and reliable DB-centric Grid Applications

Parallels Virtuozzo Containers 4.6 for Windows

High-Availability Using Open Source Software

Cloud Server. Parallels. Key Features and Benefits. White Paper.

Learn Oracle WebLogic Server 12c Administration For Middleware Administrators

Performance of Host Identity Protocol on Nokia Internet Tablet

DEPLOYMENT GUIDE Version 1.1. Configuring BIG-IP WOM with Oracle Database Data Guard, GoldenGate, Streams, and Recovery Manager

SQL Server 2012 Database Administration With AlwaysOn & Clustering Techniques

Online Schema Changes for Maximizing Uptime. David Turner - Dropbox Ben Black - Tango

Migrating Your Databases to Amazon Aurora. June 2016

Transcription:

MySQL always-up with Galera Cluster SLAC 2014 May 14, 2014, Berlin by oli.sennhauser@fromdual.com 1 / 31

About FromDual GmbH FromDual provides neutral and independent: Consulting for MySQL, Galera Cluster, MariaDB and Percona Server Support for all MySQL and Galera Cluster Remote-DBA Services for all MySQL MySQL Training Open Source Business Alliance (OSBA) Member of SOUG, DOAG, /ch/open 2 / 31

Always-up? :-( Its also about maintenance... Who loves night-shifts? Who loves weekend-work? Who does regular upgrade (DB, kernel, etc.)? Who does regular reboots (after kernel upgrade)? Why are you not doing it in your office hours? 3 / 31

The Galera Cluster for MySQL 4 / 31

Maintenance time... App Load balancing (LB) Upgrade Node 1 Node 2 RAM/HW Node O/S 3 wsrep wsrep DB? wsrep Galera replication 5 / 31

Advantages / Disadvantages Based on InnoDB SE Synchronous replication No lost transaction Active-active multi-master Cluster Read and write to any cluster node (no r/w split any more!) Read scalability and higher write throughput (Flash-Cache?) Automatic node membership control Rolling Restart (Upgrade of Hardware, O/S, DB release, etc.) True parallel replication, on row level No slave lag A bit more complicated than normal MySQL, but similar complexity as M/S Replication! No original MySQL binaries Codership MySQL binaries Be aware of Hot Spots on rows: Higher probability of deadlocks 6 / 31

Quorum and Split-brain What is the problem? Split-brain bad!? Galera is a pessimistic Cluster good! Quorum: FLOOR(n/2+1) more than half! 3-node Cluster (or 2+1) 7 / 31

Quorum 8 / 31

Installation and Configuration 9 / 31

Installation Galera Cluster consists of: A patched Codership MySQL (mysqld) Or MariaDB Galera Cluster Or Percona XtraDB Cluster The Galera Plugin (libgalera_smm.so) Ways of installation Packets (RPM, DEB) Binary tar-ball Patch MySQL source and compile both Download http://galeracluster.com/downloads/ 10 / 31

MySQL Configuration my.cnf [mysqld] default_storage_engine binlog_format = InnoDB = row innodb_autoinc_lock_mode = 2 # parallel applying innodb_flush_log_at_trx_commit = 0 # performance only! query_cache_size = 0 # Galera 3 experimental query_cache_type = 0 # Mutex! Consistency! 11 / 31

Galera Configuration my.cnf (conf.d/wsrep.cnf) [mysqld] # wsrep_provider = none wsrep_provider = /lib/plugin/libgalera_smm.so # wsrep_cluster_address = "gcomm://" wsrep_cluster_address = "gcomm://ip_node2,ip_node3" wsrep_cluster_name wsrep_node_name wsrep_sst_method wsrep_sst_auth = 'Galera Cluster' = 'Node A' = mysqldump = sst:secret 12 / 31

Operations 13 / 31

Initial Cluster start Start very 1 st node with: wsrep_cluster_address = "gcomm://" or mysqld_safe wsrep cluster address="gcomm://" this tells the node to be the first one! All other nodes normal: service mysqld start 14 / 31

Rolling Restart Scenario: Hardware-, O/S-, DB- and Galera-Upgrade MySQL configuration change During full operation!!! (99.999% HA, 5x9 HA) Rolling Restart Start one node after the other in a cycle New features or settings are used after Rolling Restart is completed 15 / 31

Demo? 16 / 31

Load Balancing Connectors Connector/J PHP: MySQLnd replication and load balancing plug-in SW Load Balancer GLB, LVS/IPVS/Ldirector, HAProxy HW Load Balancer 17 / 31

Location of Load Balancing 18 / 31

Demo? 19 / 31

Catch Node State Change Node State Change Initialized (0), Joining (1), Donor/Desynced (2), Synced (4),... Galera node acts as follows; ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 2 ERROR 1047 (08S01) at line 1: Unknown command this is ugly! Catch the state change with: wsrep_notify_cmd To start Firewall Rules (REJECT) To take node out of Load Balancer 20 / 31

Demo? 21 / 31

Online Schema Upgrade (OSU) Schema Upgrade = DDL run against the DB Change DB structure Non transactional 2 Methods: Total Order Isolation (TOI) (default) Rolling Schema Upgrade (RSU) wsrep_osu_method = {TOI RSU} 22 / 31

Total Order Isolation (TOI) Default Part of the database is locked for the duration of the DDL. + Simple, predictable and guaranteed data consistency. - Locking operation Good for fast DDL operations 23 / 31

Rolling Schema Upgrade (RSU) DDL will be only processed locally at the node. Node is desynchronized After DDL, delayed write sets are applied DDL should be manually executed at each node. + only blocking one node at a time - potentially unsafe and may fail if new and old schema are incompatible Good for slow DDL operations 24 / 31

Other security related stuff 25 / 31

Caution!! 26 / 31

Galera Network Configuration 27 / 31

WAN Cluster WAN = Wide Area Network Connect 2 or more locations over a public or private Network What are the problems? Round Trip Time (RTT) Throughput Network Stability Wrong set-ups 28 / 31

Communication encryption 2 Possibilities: 1.) Make Network secure (V-LAN, VPN with SSL, stunnel) 2.) Encrypt Galera communication with SSL Caution: only Galera replication is affected! NOT State Snapshot Transfer (SST, mysqldump mysql, rsync) NOT Client connection (mysql), use MySQL SSL encryption! But Incremental State Transfer (IST) IS affected (= Galera Protocol)! We recommend for ease of use: Do it on Network level! 29 / 31

Wir suchen noch: Datenbank Enthusiast/in für Support / remote-dba / Beratung 30 / 31

Q & A Questions? Discussion? We have time for some face-to-face talks... FromDual provides neutral and independent: Consulting Remote-DBA Support for MySQL, Galera, Percona Server and MariaDB Training 31 / 31