SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
HIGH AVAILABILITY WITH
MYSQL


             THAVA ALAGU

             Staff Engineer, Database Group,
               Sun Microsystems, Bangalore
                  thavamuni.alagu@sun.com
               http://blogs.sun.com/thava/
                                  Oct 2008
Welcome !


            2
LET US DISCUSS ABOUT …

      Aspects  of High Availability
      MySQL Replication
      MySQL Cluster
      Application HA
      Resources




                                       3
ARCHITECTURE OVERVIEW




                        4
HIGH AVAILABILITY


    Data Must Not be Lost
    Data + Application Must be
     Available Always




                                  5
MYSQL SOLUTIONS …

   MySQL Replication (Asynchronous)

   MySQL Cluster (Synchronous)

   Supporting Solutions:
     MySQL Proxy (Alpha)
     MySQL Load Balancer (Based on Proxy)
     3rd Party Solutions from Partners and Others




                                                     6
MYSQL REPLICATION HIGHLIGHTS
 Binary Log Updates From Master Applied at
  Slave
 Usually One Master  Multiple Slaves

 Asynchronous Copy

 Slave could be used as Read-Only

 Geographically Distributed, Slow Links, OK

 Can be chained –
       Master  Slave/Master  Slave




                                               7
MYSQL REPLICATION BENEFITS
 Hot Standby Node for Fail-Over
 Can be Used for transparent Backups

 Load Balancing – Slaves Can be Active for Read

 Automated copy across geographically
  distributed sites




                                                   8
REPLICATION ARCHITECTURE




                           9
REPLICATION TECHNIQUES AND
TIPS




                             10
REPLICATION NOTES


    Binary logs rotated every 1GB
    You should clean/purge old logs
    Master/Slave similar architecture




                                         11
REPLICATION FORMATS

    3 Types:
      Statement Based Replication
      Row-based Replication

      Mixed Based Replication

    Depends on MySQL Version, Storage Engine
    Can override the defaults
        e.g. use row-format=row option
    Usually row based replication is safer
        But exceptions exist


                                                12
REPLICATION FOR BACKUPS


  Slave can be shutdown for Cold Backup
  Logical or File System backups
  Backup Logs too
  Logs can be used for Point-In-Time Recovery




                                                 13
REPLICATE ACROSS STORAGE
ENGINES

 Slave  can be ARCHIVE Engine
 Insurance against SE specific failures
 Faster Slave with No Transaction Engine
  e.g. InnoDB to MyISAM
 How:
     Use storage_engine system variable
     Mysqldump; edit; reload
     Stop slave; Alter table …; Start Slave
     Disable some storage engines at Slave
     Create new tables with default engine
                                               14
REPLICATE FOR SCALING


   Use Multiple Slaves For Read Load
   Dedicate Master for Write Load
   Perfect for Load Balancing




                                        15
REPLICATE SELECTIVELY




   Filter at Slave – Database, Tables, specify in my.cnf
       replicate-wild-do-table=sales.%
       replicate-wild-do-table=finance.%
   Master Filters: binlog-do-db,       binlog-ignore-db


                                                            16
REPLICATE MULTILEVEL




 Less Load at Master
 Can Use Blackhole Engine for Master2
 Use log-slave-updates option at Master2



                                            17
MULTIMASTER (AVOID)

  2 Masters updating each other
  Ring of Masters
  Updates on disjoint sets
  Usually, Stay Away




                                   18
REPLICATION TOPOLOGIES
SUMMARY




                         19
REPLICATE USING SSL



 For High Security
 Uses Certificate-Authority Certificate,
  Server Public Key, Server Private Key




                                            20
REPLICATION SETUP UPGRADE



 Upgrade Slaves First, Then Master
 Shutdown, Upgrade, Restart
 Watch out Versions Upgradability




                                      21
REPLICATION COMMANDS
   On Master:
           Show master status
           Flush logs
           Show master logs
           Show binlog events
           Purge master logs to ‘mysql-bin.005’;

   On Slave:
            Change Master To master_host=‘hostA’ master_user=‘slave’
             master_password=‘slavepassword’ ;
            Show slave status
            Load Data From Master ; # MyISAM only. Locks Tables on master




                                                                             22
REPLICATION FAILOVER


 Does not happen automatically
 Many solutions exist like virtual IP, Sun
  Cluster, Linux-HA Heartbeat, etc
 Application should retry




                                              23
MYSQL CLUSTER HIGHLIGHTS


 Synchronous
 Ultra High Availability
 Think Telecom, Banking
 Memory (mostly) and Disk based
 No Single Point Of Failure
 Automatic Failover




                                   24
MYSQL CLUSTER ARCHITECTURE




                             25
MYSQL CLUSTER NODEGROUP




                          26
MYSQL CLUSTER SIMPLE CONFIG




                              27
MYSQL CLUSTER NOTES
   ACID transactions
   Supports READ COMMITTED only
   Synchronous replication uses 2 Phase Commit
   Local and Global Checkpoints to disk
   Data access through SQL or NDB API
   Online Backups supported
   All nodes same architecture – big endian or little endian




                                                                28
MYSQL CLUSTER NOTES (CONTD)
   Max number of data nodes = 48;
   Max(data nodes + management nodes )=63
   Max total number of all = 256 (including SQL nodes)
   Tables highly recommended to have primary keys for
    cluster replication.




                                                          29
MYSQL CLUSTER CONFIGURATION
   NDB config File = config.ini
   Number Of Replicas : 1 upto 4 [ usually 2 ]
   Memory Sizing
       Per Node Memory = (DataSize * Replicas * 1.1) / Nodes


   Default Port number for Mgmt Node = 2202
   Default Port Number for Data Node = 1186

   SQL Node Config File = my.cnf
     [mysqld]
     ndbcluster
     ndb-connectstring=mgmt-hostname




                                                                30
NODE FAILURE DETECTION
 Uses Heartbeats
 Failed Node Excluded

 Node taken over by another in same node group

 Failed node tries to repair itself and then joins
  cluster




                                                      31
NETWORK PARTITIONING
 Also Called Split Brain condition
 2 Sets of Nodes Diverges with writes

 Management node acts as arbitrator by default

 Nodes with maximum votes survive




                                                  32
CLUSTER CHECKPOINTS
 Transactions Commits in memory
 Local checkpoint writes all node data and UNDO
  log written to disk; old REDO logs can be deleted
 Global Checkpoint: Frequency controlled by
  TimeBetweenGlobalCheckpoints (default 2000
  millisecs)




                                                      33
CLUSTER COMMANDS
   ndb_mgmd –f config.ini     # start management daemon
   ndbd --connect-string=mgmt_hostname # start data node
   mysqld_safe & # Start SQL node
   ndb_mgm -c mgmt_hostname –e “show”
   mysql> show engine ndb status;




                                                            34
CLUSTER ROLLING
UPGRADE/DOWNGRADE

   Online Upgrae/Downgrade supported.
   Shutdown node, replace binary, bring it up
   One node at a time in this order:
      Management Node(s)
      Data Nodes
      SQL Nodes

   Watch out for upgradability/downgradbility of
    versions




                                                    35
REPLICATING CLUSTERS




   Note: Row-based logging must be enabled for this to work

                                                              36
ANOTHER HA SOLUTION:
DISTRIBUTED REPLICATED BLOCK
DEVICE

   Available on Linux. Provides synchronous data copy.
   Uses virtual block device
   Replicated from primary server to secondary
   Implemented with kernel level and user level software
   Often used with Heartbeat Linux Cluster manager
   Secondary server is passive – Not for load balancing
   Like RAID but software based




                                                            37
RESOURCES …

   Developer Zone: Developer Articles, etc.
       http://dev.mysql.com
   MySQL White Papers
       http://www.mysql.com/why-mysql/white-papers/
   MySQL Forums:
       http://forums.mysql.com
   Planet MySQL – Blog aggregator
       http://planetmysql.org




                                                       38
THAVA ALAGU

Blog: http://blogs.sun.com/thava/
thavamuni.alagu@sun.com
Twitter: thavamuni
Oct 2008

Mais conteúdo relacionado

Mais procurados

Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMANagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMANagios
 
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with NagiosNagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with NagiosNagios
 
High performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLHigh performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLMydbops
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...Insight Technology, Inc.
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)M Malai
 
MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)Mydbops
 
Mysql8 advance tuning with resource group
Mysql8 advance tuning with resource groupMysql8 advance tuning with resource group
Mysql8 advance tuning with resource groupMarco Tusa
 
InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)Mydbops
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼NeoClova
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQLI Goo Lee
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysqlVasudeva Rao
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016Wagner Bianchi
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesLenz Grimmer
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Vasudeva Rao
 
Download presentation
Download presentationDownload presentation
Download presentationwebhostingguy
 
MyDUMPER : Faster logical backups and restores
MyDUMPER : Faster logical backups and restores MyDUMPER : Faster logical backups and restores
MyDUMPER : Faster logical backups and restores Mydbops
 
Activemq installation and master slave setup using shared broker data
Activemq installation and master slave setup using shared broker dataActivemq installation and master slave setup using shared broker data
Activemq installation and master slave setup using shared broker dataRamakrishna Narkedamilli
 
Plny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesPlny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesDimas Prasetyo
 

Mais procurados (20)

Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMANagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
 
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with NagiosNagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
 
High performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLHigh performance and high availability proxies for MySQL
High performance and high availability proxies for MySQL
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
 
MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)
 
Mysql8 advance tuning with resource group
Mysql8 advance tuning with resource groupMysql8 advance tuning with resource group
Mysql8 advance tuning with resource group
 
InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysql
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best Practices
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10
 
Download presentation
Download presentationDownload presentation
Download presentation
 
MyDUMPER : Faster logical backups and restores
MyDUMPER : Faster logical backups and restores MyDUMPER : Faster logical backups and restores
MyDUMPER : Faster logical backups and restores
 
Activemq installation and master slave setup using shared broker data
Activemq installation and master slave setup using shared broker dataActivemq installation and master slave setup using shared broker data
Activemq installation and master slave setup using shared broker data
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
Plny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesPlny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practices
 

Destaque

MySQL Fabric: High Availability using Python/Connector
MySQL Fabric: High Availability using Python/ConnectorMySQL Fabric: High Availability using Python/Connector
MySQL Fabric: High Availability using Python/ConnectorVishal Yadav
 
MySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuseMySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuseweigon
 
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase
 
DIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL ClusterDIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL ClusterUlf Wendel
 
MySQL Proxy. From Architecture to Implementation
MySQL Proxy. From Architecture to ImplementationMySQL Proxy. From Architecture to Implementation
MySQL Proxy. From Architecture to ImplementationRonald Bradford
 
MySQL HA Solutions
MySQL HA SolutionsMySQL HA Solutions
MySQL HA SolutionsMat Keep
 
MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.Miguel Araújo
 
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4Ulf Wendel
 
MySQL 5.6 Global Transaction IDs - Use case: (session) consistency
MySQL 5.6 Global Transaction IDs - Use case: (session) consistencyMySQL 5.6 Global Transaction IDs - Use case: (session) consistency
MySQL 5.6 Global Transaction IDs - Use case: (session) consistencyUlf Wendel
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyContinuent
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL FabricMats Kindahl
 
MySQL Replication: What’s New in MySQL 5.7 and Beyond
MySQL Replication: What’s New in MySQL 5.7 and BeyondMySQL Replication: What’s New in MySQL 5.7 and Beyond
MySQL Replication: What’s New in MySQL 5.7 and BeyondAndrew Morgan
 
Using MySQL Fabric for High Availability and Scaling Out
Using MySQL Fabric for High Availability and Scaling OutUsing MySQL Fabric for High Availability and Scaling Out
Using MySQL Fabric for High Availability and Scaling OutOSSCube
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLRené Cannaò
 
Methods of Sharding MySQL
Methods of Sharding MySQLMethods of Sharding MySQL
Methods of Sharding MySQLLaine Campbell
 
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterMySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterOlivier DASINI
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityColin Charles
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
 

Destaque (20)

MySQL Fabric: High Availability using Python/Connector
MySQL Fabric: High Availability using Python/ConnectorMySQL Fabric: High Availability using Python/Connector
MySQL Fabric: High Availability using Python/Connector
 
MySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuseMySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuse
 
MySQL highav Availability
MySQL highav AvailabilityMySQL highav Availability
MySQL highav Availability
 
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
 
DIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL ClusterDIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL Cluster
 
MySQL Proxy. From Architecture to Implementation
MySQL Proxy. From Architecture to ImplementationMySQL Proxy. From Architecture to Implementation
MySQL Proxy. From Architecture to Implementation
 
MySQL Proxy tutorial
MySQL Proxy tutorialMySQL Proxy tutorial
MySQL Proxy tutorial
 
MySQL HA Solutions
MySQL HA SolutionsMySQL HA Solutions
MySQL HA Solutions
 
MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.
 
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
 
MySQL 5.6 Global Transaction IDs - Use case: (session) consistency
MySQL 5.6 Global Transaction IDs - Use case: (session) consistencyMySQL 5.6 Global Transaction IDs - Use case: (session) consistency
MySQL 5.6 Global Transaction IDs - Use case: (session) consistency
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL Fabric
 
MySQL Replication: What’s New in MySQL 5.7 and Beyond
MySQL Replication: What’s New in MySQL 5.7 and BeyondMySQL Replication: What’s New in MySQL 5.7 and Beyond
MySQL Replication: What’s New in MySQL 5.7 and Beyond
 
Using MySQL Fabric for High Availability and Scaling Out
Using MySQL Fabric for High Availability and Scaling OutUsing MySQL Fabric for High Availability and Scaling Out
Using MySQL Fabric for High Availability and Scaling Out
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
Methods of Sharding MySQL
Methods of Sharding MySQLMethods of Sharding MySQL
Methods of Sharding MySQL
 
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterMySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
 

Semelhante a High Availability with MySQL

MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningLenz Grimmer
 
Galera Multi Master Synchronous My S Q L Replication Clusters
Galera  Multi Master  Synchronous  My S Q L  Replication  ClustersGalera  Multi Master  Synchronous  My S Q L  Replication  Clusters
Galera Multi Master Synchronous My S Q L Replication ClustersPerconaPerformance
 
Make Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMake Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMySQLConference
 
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...Severalnines
 
How We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and FasterHow We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and FasterScyllaDB
 
How to build a state-of-the-art rails cluster
How to build a state-of-the-art rails clusterHow to build a state-of-the-art rails cluster
How to build a state-of-the-art rails clusterTim Lossen
 
Why MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackWhy MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackSveta Smirnova
 
UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningFromDual GmbH
 
MariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Corporation
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsLenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Louis liu
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsLenz Grimmer
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
Slides: Introducing the new ClusterControl 1.2.9 - with live demo
Slides: Introducing the new ClusterControl 1.2.9 - with live demo Slides: Introducing the new ClusterControl 1.2.9 - with live demo
Slides: Introducing the new ClusterControl 1.2.9 - with live demo Severalnines
 
Xen Virtualization 2008
Xen Virtualization 2008Xen Virtualization 2008
Xen Virtualization 2008mwlang88
 
Feed Burner Scalability
Feed Burner ScalabilityFeed Burner Scalability
Feed Burner Scalabilitydidip
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference RecapChris Barber
 

Semelhante a High Availability with MySQL (20)

MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery Planning
 
Advanced Deployment
Advanced DeploymentAdvanced Deployment
Advanced Deployment
 
MySQL Aquarium Paris
MySQL Aquarium ParisMySQL Aquarium Paris
MySQL Aquarium Paris
 
Galera Multi Master Synchronous My S Q L Replication Clusters
Galera  Multi Master  Synchronous  My S Q L  Replication  ClustersGalera  Multi Master  Synchronous  My S Q L  Replication  Clusters
Galera Multi Master Synchronous My S Q L Replication Clusters
 
Make Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMake Your Life Easier With Maatkit
Make Your Life Easier With Maatkit
 
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
 
How We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and FasterHow We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and Faster
 
How to build a state-of-the-art rails cluster
How to build a state-of-the-art rails clusterHow to build a state-of-the-art rails cluster
How to build a state-of-the-art rails cluster
 
Why MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackWhy MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it Back
 
UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL Tuning
 
MariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly Available
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
Slides: Introducing the new ClusterControl 1.2.9 - with live demo
Slides: Introducing the new ClusterControl 1.2.9 - with live demo Slides: Introducing the new ClusterControl 1.2.9 - with live demo
Slides: Introducing the new ClusterControl 1.2.9 - with live demo
 
Xen Virtualization 2008
Xen Virtualization 2008Xen Virtualization 2008
Xen Virtualization 2008
 
Feed Burner Scalability
Feed Burner ScalabilityFeed Burner Scalability
Feed Burner Scalability
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference Recap
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

High Availability with MySQL

  • 1. HIGH AVAILABILITY WITH MYSQL THAVA ALAGU Staff Engineer, Database Group, Sun Microsystems, Bangalore thavamuni.alagu@sun.com http://blogs.sun.com/thava/ Oct 2008
  • 3. LET US DISCUSS ABOUT …  Aspects of High Availability  MySQL Replication  MySQL Cluster  Application HA  Resources 3
  • 5. HIGH AVAILABILITY  Data Must Not be Lost  Data + Application Must be Available Always 5
  • 6. MYSQL SOLUTIONS …  MySQL Replication (Asynchronous)  MySQL Cluster (Synchronous)  Supporting Solutions:  MySQL Proxy (Alpha)  MySQL Load Balancer (Based on Proxy)  3rd Party Solutions from Partners and Others 6
  • 7. MYSQL REPLICATION HIGHLIGHTS  Binary Log Updates From Master Applied at Slave  Usually One Master  Multiple Slaves  Asynchronous Copy  Slave could be used as Read-Only  Geographically Distributed, Slow Links, OK  Can be chained –  Master  Slave/Master  Slave 7
  • 8. MYSQL REPLICATION BENEFITS  Hot Standby Node for Fail-Over  Can be Used for transparent Backups  Load Balancing – Slaves Can be Active for Read  Automated copy across geographically distributed sites 8
  • 11. REPLICATION NOTES  Binary logs rotated every 1GB  You should clean/purge old logs  Master/Slave similar architecture 11
  • 12. REPLICATION FORMATS  3 Types:  Statement Based Replication  Row-based Replication  Mixed Based Replication  Depends on MySQL Version, Storage Engine  Can override the defaults  e.g. use row-format=row option  Usually row based replication is safer  But exceptions exist 12
  • 13. REPLICATION FOR BACKUPS  Slave can be shutdown for Cold Backup  Logical or File System backups  Backup Logs too  Logs can be used for Point-In-Time Recovery 13
  • 14. REPLICATE ACROSS STORAGE ENGINES  Slave can be ARCHIVE Engine  Insurance against SE specific failures  Faster Slave with No Transaction Engine e.g. InnoDB to MyISAM  How:  Use storage_engine system variable  Mysqldump; edit; reload  Stop slave; Alter table …; Start Slave  Disable some storage engines at Slave  Create new tables with default engine 14
  • 15. REPLICATE FOR SCALING  Use Multiple Slaves For Read Load  Dedicate Master for Write Load  Perfect for Load Balancing 15
  • 16. REPLICATE SELECTIVELY  Filter at Slave – Database, Tables, specify in my.cnf  replicate-wild-do-table=sales.%  replicate-wild-do-table=finance.%  Master Filters: binlog-do-db, binlog-ignore-db 16
  • 17. REPLICATE MULTILEVEL  Less Load at Master  Can Use Blackhole Engine for Master2  Use log-slave-updates option at Master2 17
  • 18. MULTIMASTER (AVOID)  2 Masters updating each other  Ring of Masters  Updates on disjoint sets  Usually, Stay Away 18
  • 20. REPLICATE USING SSL  For High Security  Uses Certificate-Authority Certificate, Server Public Key, Server Private Key 20
  • 21. REPLICATION SETUP UPGRADE  Upgrade Slaves First, Then Master  Shutdown, Upgrade, Restart  Watch out Versions Upgradability 21
  • 22. REPLICATION COMMANDS  On Master:  Show master status  Flush logs  Show master logs  Show binlog events  Purge master logs to ‘mysql-bin.005’;  On Slave:  Change Master To master_host=‘hostA’ master_user=‘slave’ master_password=‘slavepassword’ ;  Show slave status  Load Data From Master ; # MyISAM only. Locks Tables on master 22
  • 23. REPLICATION FAILOVER  Does not happen automatically  Many solutions exist like virtual IP, Sun Cluster, Linux-HA Heartbeat, etc  Application should retry 23
  • 24. MYSQL CLUSTER HIGHLIGHTS  Synchronous  Ultra High Availability  Think Telecom, Banking  Memory (mostly) and Disk based  No Single Point Of Failure  Automatic Failover 24
  • 27. MYSQL CLUSTER SIMPLE CONFIG 27
  • 28. MYSQL CLUSTER NOTES  ACID transactions  Supports READ COMMITTED only  Synchronous replication uses 2 Phase Commit  Local and Global Checkpoints to disk  Data access through SQL or NDB API  Online Backups supported  All nodes same architecture – big endian or little endian 28
  • 29. MYSQL CLUSTER NOTES (CONTD)  Max number of data nodes = 48;  Max(data nodes + management nodes )=63  Max total number of all = 256 (including SQL nodes)  Tables highly recommended to have primary keys for cluster replication. 29
  • 30. MYSQL CLUSTER CONFIGURATION  NDB config File = config.ini  Number Of Replicas : 1 upto 4 [ usually 2 ]  Memory Sizing  Per Node Memory = (DataSize * Replicas * 1.1) / Nodes  Default Port number for Mgmt Node = 2202  Default Port Number for Data Node = 1186  SQL Node Config File = my.cnf  [mysqld]  ndbcluster  ndb-connectstring=mgmt-hostname 30
  • 31. NODE FAILURE DETECTION  Uses Heartbeats  Failed Node Excluded  Node taken over by another in same node group  Failed node tries to repair itself and then joins cluster 31
  • 32. NETWORK PARTITIONING  Also Called Split Brain condition  2 Sets of Nodes Diverges with writes  Management node acts as arbitrator by default  Nodes with maximum votes survive 32
  • 33. CLUSTER CHECKPOINTS  Transactions Commits in memory  Local checkpoint writes all node data and UNDO log written to disk; old REDO logs can be deleted  Global Checkpoint: Frequency controlled by TimeBetweenGlobalCheckpoints (default 2000 millisecs) 33
  • 34. CLUSTER COMMANDS  ndb_mgmd –f config.ini # start management daemon  ndbd --connect-string=mgmt_hostname # start data node  mysqld_safe & # Start SQL node  ndb_mgm -c mgmt_hostname –e “show”  mysql> show engine ndb status; 34
  • 35. CLUSTER ROLLING UPGRADE/DOWNGRADE  Online Upgrae/Downgrade supported.  Shutdown node, replace binary, bring it up  One node at a time in this order:  Management Node(s)  Data Nodes  SQL Nodes  Watch out for upgradability/downgradbility of versions 35
  • 36. REPLICATING CLUSTERS Note: Row-based logging must be enabled for this to work 36
  • 37. ANOTHER HA SOLUTION: DISTRIBUTED REPLICATED BLOCK DEVICE  Available on Linux. Provides synchronous data copy.  Uses virtual block device  Replicated from primary server to secondary  Implemented with kernel level and user level software  Often used with Heartbeat Linux Cluster manager  Secondary server is passive – Not for load balancing  Like RAID but software based 37
  • 38. RESOURCES …  Developer Zone: Developer Articles, etc.  http://dev.mysql.com  MySQL White Papers  http://www.mysql.com/why-mysql/white-papers/  MySQL Forums:  http://forums.mysql.com  Planet MySQL – Blog aggregator  http://planetmysql.org 38