SlideShare una empresa de Scribd logo
1 de 38
MySQL高可用性


                             上海爱可生信息技术有限公司 曹妙霞
                                   2010-10-16




Copyright 2010 Action Tech                       1
Agenda

   •    Questions
   •    HA Terms and Concepts
   •    HA Solutions with MySQL
   •    Other Solutions




Copyright 2010 Action Tech            2
Agenda

   •    Questions
   •    HA Terms and Concepts
   •    HA Solutions with MySQL
   •    Other Solutions




Copyright 2010 Action Tech            3
Questions
  • Do you need HA?
  • Can you afford to lose some data?
  • How qualified is your IT department or support
    company?
  • How much are you ready to invest?




Copyright 2010 Action Tech                           4
Agenda

   •    Questions
   •    HA Terms and Concepts
   •    HA Solutions with MySQL
   •    Other Solutions




Copyright 2010 Action Tech            5
Definitions
  • High Availability (HA)
    > 当出现故障时,保证资源的可用性
  • Two major categories
    > 硬件的可用性(如:硬件冗余)
    > 软件的可用性(如:解决方案)
  • Continuous Availability
    > 持续的、无间断的服务
    > 无故障停滞的时间



Copyright 2010 Action Tech                 6
Definitions
    • Fault Tolerance
      > 当硬件或软件故障时,保证资源的可用性
      > 硬件和软件冗余,如:cpu,memory,IO,MySQL
       APP
    • Single Point of Failure
     > 单台机器的硬件或软件出现故障时,停止服务
    • Fail Over
     > 当出现故障时,服务切换到可用的资源平台




Copyright 2010 Action Tech                 7
Scale-Up vs. Scale-Out
• Scale-Up
      > 垂直升级,昂贵的硬件
      > 专有软件
      > 平台绑定

• Scale-Out
      > 水平升级,普通的硬件
      > 开源软件
      > 平台独立


Copyright 2010 Action Tech                   8
The Five 9s of Availability




Copyright 2010 Action Tech                           9
Agenda

   •    Questions
   •    HA Terms and Concepts
   •    HA Solutions with MySQL
   •    Other Solutions




Copyright 2010 Action Tech            10
MySQL High Availability Solutions

   • MySQL Replication
   • MySQL Cluster
   • MySQL Cluster & Replication
   • Linux Heartbeat & MySQL Replication
   • Linux Heartbeat, DRBD & MySQL
   • MySQL w/ Shared-Storage & Clustering
     Agents


Copyright 2010 Action Tech                       11
MySQL Replication

      • 异步数据复制(Statement & Row-based、
        mixed)
      • 负载均衡,在线热备,水平扩展
      • 跨网数据复制
      • Fail Over ---- 手动切换




Copyright 2010 Action Tech                       12
MySQL Replication Topologies
                Master > Slave              Master > Slaves




  Masters > Slave (Multi-Source)          Master > Slave > Slaves




                                           Circular (Multi-Master)
Master < > Master (Multi-Master)




Copyright 2010 Action Tech                                           13
Inside MySQL Replication
  Writes & Reads


                         Web/App
                          Server
                                                                                  Writes

                                                             relay
                                                            binlog


                             mysqld                               I/O              SQL
                                                                Thread            Thread
                                   index &
                                   binlogs
         data

                                             Replication                 binlog            data
                                                           mysqld
              MySQL Master                                           MySQL Slave



Copyright 2010 Action Tech                                                                        14
MySQL Replication (Scale-Out)
                                           Web/App
                                            Server


         Writes & Reads                                  Reads


    Master Server                                     Slave Server
                                                                                   Backups




            Writes                      Replication
                                                        Writes


                             Index &                               Possible Roles
                             Bin Log                     • Fail over server
                                                         • Used for performing backups
                             Rotation
                                                         • Read load balancing
                                                         • Additional slaves allow Scale-Out




Copyright 2010 Action Tech                                                                     15
MySQL Replication (Fail-Over)
                                       Web/App
                                        Server


                                X                 Writes & Reads



              Master Server                       Slave Server




                       Writes       Replication       Writes



                                                                   Index &
                                                                   Bin Log
                                                                   Rotation




Copyright 2010 Action Tech                                                    16
MySQL Cluster
       • 无共享存储的数据存储模式
       • 实时同步数据 (2-phase commit)
       • 特有应用下的高性能,高事物吞吐量
       • 无特殊硬件需求
       • 内存存储数据 & 硬盘存储数据 (5.1)
       • Fail Over----快速、自动
       • 数据节点间心跳机制



Copyright 2010 Action Tech                   17
MySQL Cluster Components
     • 数据节点(Data Nodes)
       > 实时同步数据
       > 按组存储数据
     • 管理节点(Management Nodes)
       > 用于集群的起停
       > 状态查询、配置生效、在线热备
     • SQL节点(MySQL or NDB API Nodes)
       > 标准MySQL Client or NDB API接口
       > 在线平行扩展


Copyright 2010 Action Tech                              18
Basic Cluster Architecture
                                                                        MySQL Server or NDB
                                       Web/App       Web/App                      API
                                        Server        Server
                                                                        for all Writes & Reads




                                      MySQL             MySQL
                                      Server            Server




                                           NDB API
                                                                                     Management
          Memory                            NDB                                        Server
            &                  Data    Storage Engine            Data
           Disk                Node                              Node
                                                                                     Management
                                                                                       Server




Copyright 2010 Action Tech                                                                        19
MySQL Cluster Data Node Architecture
   ID      Capital           Country   UTC
   1    Copenhagen       Denmark 2                              Data           Data
                                             Partition 1        Node           Node
   2    Berlin           Germany 2
   3    New York City USA              -5
                                             Partition 2    P1-Primary    P1-Secondary
   4    Tokyo            Japan         9
   5    Athens           Greece        2
                                                           P2-Secondary    P2-Primary
                                             Partition 3
   6    Moscow           Russia        4
   7    Oslo             Norway        2
                                                                Node Group 1
                                             Partition 4
   8    Beijing          China         8


                                                                Data           Data
                                                                Node           Node
         • Four Data Nodes
         • Two Replicas                                     P3-Primary    P3-Secondary
                                                           P4-Secondary    P4-Primary
         • Two Node Groups
                                                                Node Group 2



Copyright 2010 Action Tech                                                               20
MySQL Cluster Data Node Architecture
     ID      Capital         Country   UTC
     1    Copenhagen         Denmark 2                         Data         Data
                                             Partition 1       Node         Node
     2    Berlin             Germany 2
     3    New York City USA            -5                                  P1-
                                             Partition 2   P1-Primary
     4    Tokyo              Japan     9                      P2-       Secondary
                                                                        P2-Primary
     5    Athens             Greece    2                   Secondary
                                             Partition 3
     6    Moscow             Russia    4                                             data still
                                                               Node Group 1          available
     7    Oslo               Norway    2
                                             Partition 4
     8    Beijing            China     8


                                                               Data         Data
                                                               Node         Node

              • Four Data Nodes                                            P3-
                                                           P3-Primary
              • Two Replicas                                  P4-       Secondary
                                                                        P4-Primary
              • Two Node Groups                            Secondary

                                                               Node Group 2



Copyright 2010 Action Tech                                                                        21
Scale-Out Cluster Architecture

                             MySQL          MySQL      MySQL    MySQL     MySQL
                             Server         Server     Server   Server    Server




                                        NDB API


                         Data              NDB          Data             Management
                         Node                           Node               Server
                                      Storage Engine

                         Data                           Data
                         Node                           Node             Management
                                                                           Server




                                              MySQL Cluster



Copyright 2010 Action Tech                                                            22
Cluster Architecture – Fail Over


                              MySQL          MySQL      MySQL    MySQL     MySQL
                              Server         Server     Server   Server    Server




                                         NDB API


                             Data           NDB          Data             Management
                             Node                        Node               Server
                                       Storage Engine


                             Data                        Data
                             Node                        Node             Management
                                                                            Server




                                               MySQL Cluster


Copyright 2010 Action Tech                                                             23
MySQL Cluster w/Replication
       Writes & Reads
                               Web/App
                                Server
                                                                                           Writes

                                                                    relay
                                                                   binlog

                                    mysqld
                                                                         I/O                SQL
                                     binlog_index                      Thread              Thread

                                         index &
                                         binlogs
                                                                                                    Data Nodes

     Data Nodes                                                                              NDB

                              NDB
                                                    Replication                   binlog

                                                                  mysqld
       apply_status


                             MySQL Master                                  MySQL Slave


                MySQL Cluster                                                   MySQL Cluster



  Global Redundancy: Business Continuity & Disaster Recovery



Copyright 2010 Action Tech                                                                                       24
Heartbeat & MySQL Replication
• 心跳机制---- 资源故障切换的安全管理
• 虚拟IP管理---- 对应用访问数据库透明化
• 方案特点
  > 配置简易性
  > 开源、低成本
  > 冗余资源自动管理
  > 自动VIP管理
  > 异步的数据复制
  > 手动或自动管理 Fail Over切换



Copyright 2010 Action Tech                         25
Heartbeat & MySQL Replication
                                    Web/App
                                     Server




                              Linux Heartbeat
                                = Virtual IP =
    Master Server                10.10.10.10     Slave Server




                                Replication        = Private IP =
         = Private IP =
          10.10.10.20                               10.10.10.21




Copyright 2010 Action Tech                                          26
Heartbeat & MySQL Replication (Fail Over)
                                     Web/App
                                      Server




                             Linux Heartbeat
                                 = Virtual IP =
    Master Server                 10.10.10.10     Slave Server


                             X
                                 Replication
         = Private IP =                           = Private IP =
          10.10.10.20                              10.10.10.21




Copyright 2010 Action Tech                                         27
Heartbeat, Block-Replication & MySQL
 • 分布式块复制 (DRBD)
   > 运行在标准网络协议上的分布式存储机制
   > 功能类似网络 RAID
   > 异步块复制
 • 特点
   > 开源的DRBD配置和安装
   > 无需专有的网络协议
   > 更高的复制性能 (blocks vs. rows of data)
   > 出现故障时自动切换接管数据
   > 结合heartbeat机制管理 fail over 和 virtual
     IPs

Copyright 2010 Action Tech                         28
Heartbeat, Block-Replication & MySQL
                                   Web/App
                                    Server




                             Linux Heartbeat
                               = Virtual IP =
    Active Server               10.10.10.10
                                                Passive Server



        = Private IP =                             = Private IP =
         10.10.10.20                                10.10.10.21

   Primary DRBD                    DRB              Secondary DRBD
                                    D




Copyright 2010 Action Tech                                           29
Heartbeat, Block-Replication & MySQL
                                    Web/App
                                     Server




                             Linux Heartbeat
                               = Virtual IP =
      Active Server             10.10.10.10     Passive Server



          = Private IP =
           10.10.10.20
                             X                     = Private IP =
                                                    10.10.10.21

     Primary DRBD                  DRB              Secondary DRBD
                                    D




Copyright 2010 Action Tech                                           30
MySQL w/ Shared Storage
     • Active/Passive
       > 多实例并行访问同一份数据文件

     • 特点
       > 较高的成本开销 (storage, hardware,
         software)
       > 自动管理Virtual IPs,Fail over,数据一致
       > fail over ,Mounting file systems时间略长
       > 众多的数据库配置可缩短接管时间
       > 严格的切换次序



Copyright 2010 Action Tech                             31
MySQL w/ Shared Storage Architecture
                                     Web/App
                                      Server




                             Cluster Management
                                 = Virtual IP =
                                  10.10.10.10
        Active Server                                Passive Server



           Cluster Agent                               Cluster Agent

            = Private IP =                              = Private IP =
             10.10.10.20                                 10.10.10.21

                                               SAN



Copyright 2010 Action Tech                                               32
MySQL w/ Shared Storage (Fail Over)
                                     Web/App
                                      Server




                             Cluster Management    Passive Server
     Active Server               = Virtual IP =
                                  10.10.10.10


                               X
        Cluster Agent
                               X
                                                     Cluster Agent


         = Private IP =                               = Private IP =
          10.10.10.20                                  10.10.10.21

                                             SAN

Copyright 2010 Action Tech                                             33
Agenda

   •    Questions
   •    HA Terms and Concepts
   •    HA Solutions with MySQL
   •    Other Solutions




Copyright 2010 Action Tech            34
Additional HA Solutions for MySQL
  • Load Balancing with MySQL Replication
    LVS Management(Similar to Linux Heartbeat)
  • Semi-synchronous Replication (google code)
  • Proxy with MySQL Replication




Copyright 2010 Action Tech                              35
Additional HA Solutions for MySQL
   •      Performance Networking for MySQL Clusters
          > Dolphin SCI Interconnect
   •      Operating System Clustering
          > Sun Solaris – Sun Cluster
          > Microsoft Windows Clustering Services
          > Red Hat Cluster Suite
   •      High Availability Middleware
          > Continuent m/Cluster http://solutions.mysql.com/
   •      Backup Software
          > Zmanda

                             HighAvailability.com


Copyright 2010 Action Tech                                     36
Additional MySQL HA Resources
     • MySQL Training
     • MySQL Network
     • White Papers
     • Case Studies
     • Press Releases, News, Events
     • Live Webinars
     • Webinars on Demand               www.mysql.com




Copyright 2010 Action Tech                              37
谢谢!


           技术服务热线            400-820-6580

           在线服务网站            www.actionsky.com




Copyright 2010 Action Tech                             38

Más contenido relacionado

La actualidad más candente

MySQL Cluster NoSQL Memcached API
MySQL Cluster NoSQL Memcached APIMySQL Cluster NoSQL Memcached API
MySQL Cluster NoSQL Memcached APIMat Keep
 
NoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worldsNoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worldsMat Keep
 
OSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckOSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckAaron Walker
 
Enterprise Virtualization with Xen
Enterprise Virtualization with XenEnterprise Virtualization with Xen
Enterprise Virtualization with XenFrank Martin
 
MySQL Features & Implementation
MySQL Features & ImplementationMySQL Features & Implementation
MySQL Features & ImplementationOSSCube
 
Microsoft SQL Server Distributing Data with R2 Bertucci
Microsoft SQL Server Distributing Data with R2 BertucciMicrosoft SQL Server Distributing Data with R2 Bertucci
Microsoft SQL Server Distributing Data with R2 BertucciMark Ginnebaugh
 
Server Day 2009: Oracle/Bea Fusion Middleware by Paolo Ramasso
Server Day 2009: Oracle/Bea Fusion Middleware by Paolo RamassoServer Day 2009: Oracle/Bea Fusion Middleware by Paolo Ramasso
Server Day 2009: Oracle/Bea Fusion Middleware by Paolo RamassoJUG Genova
 
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...CUBRID
 
A beginners guide to MariaDB
A beginners guide to MariaDBA beginners guide to MariaDB
A beginners guide to MariaDBColin Charles
 
Databases in the hosted cloud
Databases in the hosted cloud Databases in the hosted cloud
Databases in the hosted cloud Colin Charles
 
Lap Around Sql Azure
Lap Around Sql AzureLap Around Sql Azure
Lap Around Sql AzureAnko Duizer
 
Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0Colin Charles
 
Cloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsCloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsMark Slingsby
 
MariaDB 10 and what's new with the project
MariaDB 10 and what's new with the projectMariaDB 10 and what's new with the project
MariaDB 10 and what's new with the projectColin Charles
 
MySQL Performance Tuning
MySQL Performance TuningMySQL Performance Tuning
MySQL Performance TuningFromDual GmbH
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)Colin Charles
 
MariaDB - a MySQL Replacement #SELF2014
MariaDB - a MySQL Replacement #SELF2014MariaDB - a MySQL Replacement #SELF2014
MariaDB - a MySQL Replacement #SELF2014Colin Charles
 
Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7Arun Gupta
 

La actualidad más candente (20)

MySQL Cluster NoSQL Memcached API
MySQL Cluster NoSQL Memcached APIMySQL Cluster NoSQL Memcached API
MySQL Cluster NoSQL Memcached API
 
MySQL 开发
MySQL 开发MySQL 开发
MySQL 开发
 
NoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worldsNoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worlds
 
OSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckOSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suck
 
Enterprise Virtualization with Xen
Enterprise Virtualization with XenEnterprise Virtualization with Xen
Enterprise Virtualization with Xen
 
MySQL Features & Implementation
MySQL Features & ImplementationMySQL Features & Implementation
MySQL Features & Implementation
 
Microsoft SQL Server Distributing Data with R2 Bertucci
Microsoft SQL Server Distributing Data with R2 BertucciMicrosoft SQL Server Distributing Data with R2 Bertucci
Microsoft SQL Server Distributing Data with R2 Bertucci
 
Server Day 2009: Oracle/Bea Fusion Middleware by Paolo Ramasso
Server Day 2009: Oracle/Bea Fusion Middleware by Paolo RamassoServer Day 2009: Oracle/Bea Fusion Middleware by Paolo Ramasso
Server Day 2009: Oracle/Bea Fusion Middleware by Paolo Ramasso
 
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
 
A beginners guide to MariaDB
A beginners guide to MariaDBA beginners guide to MariaDB
A beginners guide to MariaDB
 
Databases in the hosted cloud
Databases in the hosted cloud Databases in the hosted cloud
Databases in the hosted cloud
 
Lap Around Sql Azure
Lap Around Sql AzureLap Around Sql Azure
Lap Around Sql Azure
 
Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0
 
Cloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsCloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web Apps
 
MariaDB 10 and what's new with the project
MariaDB 10 and what's new with the projectMariaDB 10 and what's new with the project
MariaDB 10 and what's new with the project
 
MySQL Performance Tuning
MySQL Performance TuningMySQL Performance Tuning
MySQL Performance Tuning
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)
 
Why MariaDB?
Why MariaDB?Why MariaDB?
Why MariaDB?
 
MariaDB - a MySQL Replacement #SELF2014
MariaDB - a MySQL Replacement #SELF2014MariaDB - a MySQL Replacement #SELF2014
MariaDB - a MySQL Replacement #SELF2014
 
Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7
 

Similar a MySQL高可用

Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...Software Park Thailand
 
Oracle my sql cluster cge
Oracle my sql cluster cgeOracle my sql cluster cge
Oracle my sql cluster cgeseungdon1
 
My sql 5.5_product_update
My sql 5.5_product_updateMy sql 5.5_product_update
My sql 5.5_product_updatehenriquesidney
 
MySQL 5.6 Updates
MySQL 5.6 UpdatesMySQL 5.6 Updates
MySQL 5.6 UpdatesDave Stokes
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL SupportMysql User Camp
 
SQL Server Workshop Paul Bertucci
SQL Server Workshop Paul BertucciSQL Server Workshop Paul Bertucci
SQL Server Workshop Paul BertucciMark Ginnebaugh
 
SQL Server 2008 Migration Workshop 04/29/2009
SQL Server 2008 Migration Workshop 04/29/2009SQL Server 2008 Migration Workshop 04/29/2009
SQL Server 2008 Migration Workshop 04/29/2009Database Architechs
 
Mysql ecosystem in 2019
Mysql ecosystem in 2019Mysql ecosystem in 2019
Mysql ecosystem in 2019Alkin Tezuysal
 
1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivan1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivanIvan Tu
 
UKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA'sUKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA'sFromDual GmbH
 
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Manuel Contreras
 
The Art & Sience of Optimization
The Art & Sience of OptimizationThe Art & Sience of Optimization
The Art & Sience of OptimizationHertzel Karbasi
 
Oracle mysql comparison
Oracle mysql comparisonOracle mysql comparison
Oracle mysql comparisonArun Sharma
 
My sqlstrategyroadmap
My sqlstrategyroadmapMy sqlstrategyroadmap
My sqlstrategyroadmapslidethanks
 
MySQL Strategy&Roadmap
MySQL Strategy&RoadmapMySQL Strategy&Roadmap
MySQL Strategy&Roadmapslidethanks
 
Tutorial MySQL com Java
Tutorial MySQL com JavaTutorial MySQL com Java
Tutorial MySQL com JavaMySQL Brasil
 
Summer training oracle
Summer training   oracle Summer training   oracle
Summer training oracle Arshit Rai
 

Similar a MySQL高可用 (20)

Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
 
Oracle my sql cluster cge
Oracle my sql cluster cgeOracle my sql cluster cge
Oracle my sql cluster cge
 
My sql 5.5_product_update
My sql 5.5_product_updateMy sql 5.5_product_update
My sql 5.5_product_update
 
MySQL Cluster
MySQL ClusterMySQL Cluster
MySQL Cluster
 
SQL Server User Group 02/2009
SQL Server User Group 02/2009SQL Server User Group 02/2009
SQL Server User Group 02/2009
 
MySQL 5.6 Updates
MySQL 5.6 UpdatesMySQL 5.6 Updates
MySQL 5.6 Updates
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
SQL Server Workshop Paul Bertucci
SQL Server Workshop Paul BertucciSQL Server Workshop Paul Bertucci
SQL Server Workshop Paul Bertucci
 
SQL Server 2008 Migration Workshop 04/29/2009
SQL Server 2008 Migration Workshop 04/29/2009SQL Server 2008 Migration Workshop 04/29/2009
SQL Server 2008 Migration Workshop 04/29/2009
 
Mysql ecosystem in 2019
Mysql ecosystem in 2019Mysql ecosystem in 2019
Mysql ecosystem in 2019
 
1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivan1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivan
 
UKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA'sUKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA's
 
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
 
The Art & Sience of Optimization
The Art & Sience of OptimizationThe Art & Sience of Optimization
The Art & Sience of Optimization
 
Oracle mysql comparison
Oracle mysql comparisonOracle mysql comparison
Oracle mysql comparison
 
My sqlstrategyroadmap
My sqlstrategyroadmapMy sqlstrategyroadmap
My sqlstrategyroadmap
 
MySQL Strategy&Roadmap
MySQL Strategy&RoadmapMySQL Strategy&Roadmap
MySQL Strategy&Roadmap
 
Tutorial MySQL com Java
Tutorial MySQL com JavaTutorial MySQL com Java
Tutorial MySQL com Java
 
Summer training oracle
Summer training   oracle Summer training   oracle
Summer training oracle
 

Más de thinkinlamp

对My sql dba的一些思考
对My sql dba的一些思考对My sql dba的一些思考
对My sql dba的一些思考thinkinlamp
 
云端的数据库
云端的数据库云端的数据库
云端的数据库thinkinlamp
 
My sql innovation work -innosql
My sql innovation work -innosqlMy sql innovation work -innosql
My sql innovation work -innosqlthinkinlamp
 
浅谈 My sql 性能调优
浅谈 My sql 性能调优浅谈 My sql 性能调优
浅谈 My sql 性能调优thinkinlamp
 
2011 06-12-why do we need the rabbit
2011 06-12-why do we need the rabbit2011 06-12-why do we need the rabbit
2011 06-12-why do we need the rabbitthinkinlamp
 
2011 06-12-lamp-mysql-顾春江
2011 06-12-lamp-mysql-顾春江2011 06-12-lamp-mysql-顾春江
2011 06-12-lamp-mysql-顾春江thinkinlamp
 
大型微博应用Feed系统浅析
大型微博应用Feed系统浅析大型微博应用Feed系统浅析
大型微博应用Feed系统浅析thinkinlamp
 
Enterprise connect
Enterprise connectEnterprise connect
Enterprise connectthinkinlamp
 
I os tech talk 观后感
I os tech talk 观后感I os tech talk 观后感
I os tech talk 观后感thinkinlamp
 
网页游戏开发与敏捷开发
网页游戏开发与敏捷开发网页游戏开发与敏捷开发
网页游戏开发与敏捷开发thinkinlamp
 
My sql自动化监控
My sql自动化监控My sql自动化监控
My sql自动化监控thinkinlamp
 
服务化的网站架构
服务化的网站架构服务化的网站架构
服务化的网站架构thinkinlamp
 
大型互联网应用架构设计
大型互联网应用架构设计大型互联网应用架构设计
大型互联网应用架构设计thinkinlamp
 
Php extension开发
Php extension开发Php extension开发
Php extension开发thinkinlamp
 
Nosql七种武器之长生剑 mongodb的使用介绍
Nosql七种武器之长生剑 mongodb的使用介绍Nosql七种武器之长生剑 mongodb的使用介绍
Nosql七种武器之长生剑 mongodb的使用介绍thinkinlamp
 
大型Sns数据库设计
大型Sns数据库设计大型Sns数据库设计
大型Sns数据库设计thinkinlamp
 
Mysql overview_20100811
Mysql overview_20100811Mysql overview_20100811
Mysql overview_20100811thinkinlamp
 
面向搜索引擎的友好程序开发
面向搜索引擎的友好程序开发面向搜索引擎的友好程序开发
面向搜索引擎的友好程序开发thinkinlamp
 

Más de thinkinlamp (20)

数据仓库
数据仓库数据仓库
数据仓库
 
对My sql dba的一些思考
对My sql dba的一些思考对My sql dba的一些思考
对My sql dba的一些思考
 
云端的数据库
云端的数据库云端的数据库
云端的数据库
 
My sql innovation work -innosql
My sql innovation work -innosqlMy sql innovation work -innosql
My sql innovation work -innosql
 
浅谈 My sql 性能调优
浅谈 My sql 性能调优浅谈 My sql 性能调优
浅谈 My sql 性能调优
 
2011 06-12-why do we need the rabbit
2011 06-12-why do we need the rabbit2011 06-12-why do we need the rabbit
2011 06-12-why do we need the rabbit
 
2011 06-12-lamp-mysql-顾春江
2011 06-12-lamp-mysql-顾春江2011 06-12-lamp-mysql-顾春江
2011 06-12-lamp-mysql-顾春江
 
蜘蛛
蜘蛛蜘蛛
蜘蛛
 
大型微博应用Feed系统浅析
大型微博应用Feed系统浅析大型微博应用Feed系统浅析
大型微博应用Feed系统浅析
 
Enterprise connect
Enterprise connectEnterprise connect
Enterprise connect
 
I os tech talk 观后感
I os tech talk 观后感I os tech talk 观后感
I os tech talk 观后感
 
网页游戏开发与敏捷开发
网页游戏开发与敏捷开发网页游戏开发与敏捷开发
网页游戏开发与敏捷开发
 
My sql自动化监控
My sql自动化监控My sql自动化监控
My sql自动化监控
 
服务化的网站架构
服务化的网站架构服务化的网站架构
服务化的网站架构
 
大型互联网应用架构设计
大型互联网应用架构设计大型互联网应用架构设计
大型互联网应用架构设计
 
Php extension开发
Php extension开发Php extension开发
Php extension开发
 
Nosql七种武器之长生剑 mongodb的使用介绍
Nosql七种武器之长生剑 mongodb的使用介绍Nosql七种武器之长生剑 mongodb的使用介绍
Nosql七种武器之长生剑 mongodb的使用介绍
 
大型Sns数据库设计
大型Sns数据库设计大型Sns数据库设计
大型Sns数据库设计
 
Mysql overview_20100811
Mysql overview_20100811Mysql overview_20100811
Mysql overview_20100811
 
面向搜索引擎的友好程序开发
面向搜索引擎的友好程序开发面向搜索引擎的友好程序开发
面向搜索引擎的友好程序开发
 

Último

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Último (20)

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

MySQL高可用

  • 1. MySQL高可用性 上海爱可生信息技术有限公司 曹妙霞 2010-10-16 Copyright 2010 Action Tech 1
  • 2. Agenda • Questions • HA Terms and Concepts • HA Solutions with MySQL • Other Solutions Copyright 2010 Action Tech 2
  • 3. Agenda • Questions • HA Terms and Concepts • HA Solutions with MySQL • Other Solutions Copyright 2010 Action Tech 3
  • 4. Questions • Do you need HA? • Can you afford to lose some data? • How qualified is your IT department or support company? • How much are you ready to invest? Copyright 2010 Action Tech 4
  • 5. Agenda • Questions • HA Terms and Concepts • HA Solutions with MySQL • Other Solutions Copyright 2010 Action Tech 5
  • 6. Definitions • High Availability (HA) > 当出现故障时,保证资源的可用性 • Two major categories > 硬件的可用性(如:硬件冗余) > 软件的可用性(如:解决方案) • Continuous Availability > 持续的、无间断的服务 > 无故障停滞的时间 Copyright 2010 Action Tech 6
  • 7. Definitions • Fault Tolerance > 当硬件或软件故障时,保证资源的可用性 > 硬件和软件冗余,如:cpu,memory,IO,MySQL APP • Single Point of Failure > 单台机器的硬件或软件出现故障时,停止服务 • Fail Over > 当出现故障时,服务切换到可用的资源平台 Copyright 2010 Action Tech 7
  • 8. Scale-Up vs. Scale-Out • Scale-Up > 垂直升级,昂贵的硬件 > 专有软件 > 平台绑定 • Scale-Out > 水平升级,普通的硬件 > 开源软件 > 平台独立 Copyright 2010 Action Tech 8
  • 9. The Five 9s of Availability Copyright 2010 Action Tech 9
  • 10. Agenda • Questions • HA Terms and Concepts • HA Solutions with MySQL • Other Solutions Copyright 2010 Action Tech 10
  • 11. MySQL High Availability Solutions • MySQL Replication • MySQL Cluster • MySQL Cluster & Replication • Linux Heartbeat & MySQL Replication • Linux Heartbeat, DRBD & MySQL • MySQL w/ Shared-Storage & Clustering Agents Copyright 2010 Action Tech 11
  • 12. MySQL Replication • 异步数据复制(Statement & Row-based、 mixed) • 负载均衡,在线热备,水平扩展 • 跨网数据复制 • Fail Over ---- 手动切换 Copyright 2010 Action Tech 12
  • 13. MySQL Replication Topologies Master > Slave Master > Slaves Masters > Slave (Multi-Source) Master > Slave > Slaves Circular (Multi-Master) Master < > Master (Multi-Master) Copyright 2010 Action Tech 13
  • 14. Inside MySQL Replication Writes & Reads Web/App Server Writes relay binlog mysqld I/O SQL Thread Thread index & binlogs data Replication binlog data mysqld MySQL Master MySQL Slave Copyright 2010 Action Tech 14
  • 15. MySQL Replication (Scale-Out) Web/App Server Writes & Reads Reads Master Server Slave Server Backups Writes Replication Writes Index & Possible Roles Bin Log • Fail over server • Used for performing backups Rotation • Read load balancing • Additional slaves allow Scale-Out Copyright 2010 Action Tech 15
  • 16. MySQL Replication (Fail-Over) Web/App Server X Writes & Reads Master Server Slave Server Writes Replication Writes Index & Bin Log Rotation Copyright 2010 Action Tech 16
  • 17. MySQL Cluster • 无共享存储的数据存储模式 • 实时同步数据 (2-phase commit) • 特有应用下的高性能,高事物吞吐量 • 无特殊硬件需求 • 内存存储数据 & 硬盘存储数据 (5.1) • Fail Over----快速、自动 • 数据节点间心跳机制 Copyright 2010 Action Tech 17
  • 18. MySQL Cluster Components • 数据节点(Data Nodes) > 实时同步数据 > 按组存储数据 • 管理节点(Management Nodes) > 用于集群的起停 > 状态查询、配置生效、在线热备 • SQL节点(MySQL or NDB API Nodes) > 标准MySQL Client or NDB API接口 > 在线平行扩展 Copyright 2010 Action Tech 18
  • 19. Basic Cluster Architecture MySQL Server or NDB Web/App Web/App API Server Server for all Writes & Reads MySQL MySQL Server Server NDB API Management Memory NDB Server & Data Storage Engine Data Disk Node Node Management Server Copyright 2010 Action Tech 19
  • 20. MySQL Cluster Data Node Architecture ID Capital Country UTC 1 Copenhagen Denmark 2 Data Data Partition 1 Node Node 2 Berlin Germany 2 3 New York City USA -5 Partition 2 P1-Primary P1-Secondary 4 Tokyo Japan 9 5 Athens Greece 2 P2-Secondary P2-Primary Partition 3 6 Moscow Russia 4 7 Oslo Norway 2 Node Group 1 Partition 4 8 Beijing China 8 Data Data Node Node • Four Data Nodes • Two Replicas P3-Primary P3-Secondary P4-Secondary P4-Primary • Two Node Groups Node Group 2 Copyright 2010 Action Tech 20
  • 21. MySQL Cluster Data Node Architecture ID Capital Country UTC 1 Copenhagen Denmark 2 Data Data Partition 1 Node Node 2 Berlin Germany 2 3 New York City USA -5 P1- Partition 2 P1-Primary 4 Tokyo Japan 9 P2- Secondary P2-Primary 5 Athens Greece 2 Secondary Partition 3 6 Moscow Russia 4 data still Node Group 1 available 7 Oslo Norway 2 Partition 4 8 Beijing China 8 Data Data Node Node • Four Data Nodes P3- P3-Primary • Two Replicas P4- Secondary P4-Primary • Two Node Groups Secondary Node Group 2 Copyright 2010 Action Tech 21
  • 22. Scale-Out Cluster Architecture MySQL MySQL MySQL MySQL MySQL Server Server Server Server Server NDB API Data NDB Data Management Node Node Server Storage Engine Data Data Node Node Management Server MySQL Cluster Copyright 2010 Action Tech 22
  • 23. Cluster Architecture – Fail Over MySQL MySQL MySQL MySQL MySQL Server Server Server Server Server NDB API Data NDB Data Management Node Node Server Storage Engine Data Data Node Node Management Server MySQL Cluster Copyright 2010 Action Tech 23
  • 24. MySQL Cluster w/Replication Writes & Reads Web/App Server Writes relay binlog mysqld I/O SQL binlog_index Thread Thread index & binlogs Data Nodes Data Nodes NDB NDB Replication binlog mysqld apply_status MySQL Master MySQL Slave MySQL Cluster MySQL Cluster Global Redundancy: Business Continuity & Disaster Recovery Copyright 2010 Action Tech 24
  • 25. Heartbeat & MySQL Replication • 心跳机制---- 资源故障切换的安全管理 • 虚拟IP管理---- 对应用访问数据库透明化 • 方案特点 > 配置简易性 > 开源、低成本 > 冗余资源自动管理 > 自动VIP管理 > 异步的数据复制 > 手动或自动管理 Fail Over切换 Copyright 2010 Action Tech 25
  • 26. Heartbeat & MySQL Replication Web/App Server Linux Heartbeat = Virtual IP = Master Server 10.10.10.10 Slave Server Replication = Private IP = = Private IP = 10.10.10.20 10.10.10.21 Copyright 2010 Action Tech 26
  • 27. Heartbeat & MySQL Replication (Fail Over) Web/App Server Linux Heartbeat = Virtual IP = Master Server 10.10.10.10 Slave Server X Replication = Private IP = = Private IP = 10.10.10.20 10.10.10.21 Copyright 2010 Action Tech 27
  • 28. Heartbeat, Block-Replication & MySQL • 分布式块复制 (DRBD) > 运行在标准网络协议上的分布式存储机制 > 功能类似网络 RAID > 异步块复制 • 特点 > 开源的DRBD配置和安装 > 无需专有的网络协议 > 更高的复制性能 (blocks vs. rows of data) > 出现故障时自动切换接管数据 > 结合heartbeat机制管理 fail over 和 virtual IPs Copyright 2010 Action Tech 28
  • 29. Heartbeat, Block-Replication & MySQL Web/App Server Linux Heartbeat = Virtual IP = Active Server 10.10.10.10 Passive Server = Private IP = = Private IP = 10.10.10.20 10.10.10.21 Primary DRBD DRB Secondary DRBD D Copyright 2010 Action Tech 29
  • 30. Heartbeat, Block-Replication & MySQL Web/App Server Linux Heartbeat = Virtual IP = Active Server 10.10.10.10 Passive Server = Private IP = 10.10.10.20 X = Private IP = 10.10.10.21 Primary DRBD DRB Secondary DRBD D Copyright 2010 Action Tech 30
  • 31. MySQL w/ Shared Storage • Active/Passive > 多实例并行访问同一份数据文件 • 特点 > 较高的成本开销 (storage, hardware, software) > 自动管理Virtual IPs,Fail over,数据一致 > fail over ,Mounting file systems时间略长 > 众多的数据库配置可缩短接管时间 > 严格的切换次序 Copyright 2010 Action Tech 31
  • 32. MySQL w/ Shared Storage Architecture Web/App Server Cluster Management = Virtual IP = 10.10.10.10 Active Server Passive Server Cluster Agent Cluster Agent = Private IP = = Private IP = 10.10.10.20 10.10.10.21 SAN Copyright 2010 Action Tech 32
  • 33. MySQL w/ Shared Storage (Fail Over) Web/App Server Cluster Management Passive Server Active Server = Virtual IP = 10.10.10.10 X Cluster Agent X Cluster Agent = Private IP = = Private IP = 10.10.10.20 10.10.10.21 SAN Copyright 2010 Action Tech 33
  • 34. Agenda • Questions • HA Terms and Concepts • HA Solutions with MySQL • Other Solutions Copyright 2010 Action Tech 34
  • 35. Additional HA Solutions for MySQL • Load Balancing with MySQL Replication LVS Management(Similar to Linux Heartbeat) • Semi-synchronous Replication (google code) • Proxy with MySQL Replication Copyright 2010 Action Tech 35
  • 36. Additional HA Solutions for MySQL • Performance Networking for MySQL Clusters > Dolphin SCI Interconnect • Operating System Clustering > Sun Solaris – Sun Cluster > Microsoft Windows Clustering Services > Red Hat Cluster Suite • High Availability Middleware > Continuent m/Cluster http://solutions.mysql.com/ • Backup Software > Zmanda HighAvailability.com Copyright 2010 Action Tech 36
  • 37. Additional MySQL HA Resources • MySQL Training • MySQL Network • White Papers • Case Studies • Press Releases, News, Events • Live Webinars • Webinars on Demand www.mysql.com Copyright 2010 Action Tech 37
  • 38. 谢谢! 技术服务热线 400-820-6580 在线服务网站 www.actionsky.com Copyright 2010 Action Tech 38