solutions for high availability and disaster recovery with mysql

Upload: noyeem-mahbub

Post on 04-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    1/42

    USE IMPROVE EVANGELIZE

    Solutions for HighAvailability andDisaster Recovery

    with MySQLDetlef UlherrSun Microsystems

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    2/42

    2

    USE IMPROVE EVANGELIZE

    Why Is High AvailabilityImportant?

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    3/42

    3

    USE IMPROVE EVANGELIZE

    Why is HA Important?

    Downtime is costly to the business

    Components or systems failures are realpossibilities

    Hardware, Software, Human Error, Disaster

    Automated recovery is the goal

    With a single physical system, single

    points of failure have greater impactsNetwork card dies, CPU misbehaves, Disk drivecrashes ...HA Clusters and Solaris automate the

    recovery process from inevitable

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    4/424

    USE IMPROVE EVANGELIZE

    HA Architectures forMySQL

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    5/42

    5

    USE IMPROVE EVANGELIZE

    HA Architectures for MySQL

    Shared nothing

    MySQL replication

    MySQL Cluster

    Solaris Cluster / Open HA Cluster(planned)

    Shared disk

    Solaris Cluster / Open HA Cluster

    VCS, HACMP, MC Serviceguard andsimilar.

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    6/42

    6

    USE IMPROVE EVANGELIZE

    HA Architectures for MySQL (cont.)

    Replicated Disk

    Linux + DRBD

    Solaris Cluster/Open HA cluster + AVS

    (planned)

    Solaris Cluster/Open HA cluster +SRDF/Truecopy

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    7/42

    7

    USE IMPROVE EVANGELIZE

    MySQL and BusinessContinuity

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    8/42

    8

    USE IMPROVE EVANGELIZE

    MySQL and Business ContinuityBuilding Blocks

    Local HA

    Infrastructure

    Replication

    Networks

    Nameservice

    DR Framework

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    9/42

    9

    USE IMPROVE EVANGELIZE

    MySQL and Business ContinuityBuilding Blocks

    Most important: People and Processes

    Training

    Management

    Periodic DR tests

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    10/42

    10

    USE IMPROVE EVANGELIZE

    MySQL's AvailabilityFeatures

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    11/42

    11

    USE IMPROVE EVANGELIZE

    MySQL's Availability Features

    ReplicationAsynchronous

    Read mostly scale out

    MySQL ClusterSynchronous

    High write profile (Commit latency)

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    12/42

    12

    USE IMPROVE EVANGELIZE

    When to use MySQL Cluster

    Your database design is good for horizontalpartitioning.

    The cluster should provide HA for MySQLonly.

    You can tolerate downtimes while adding datanodes.

    The memory is large enough for at least twice

    all the indexes.

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    13/42

    13

    USE IMPROVE EVANGELIZE

    MySQL and Solaris

    Cluster / Open HACluster

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    14/42

    14

    USE IMPROVE EVANGELIZE

    Open HA Cluster Benefits

    A shared disk HA is simpler than replication orMySQL Cluster

    Provides automated failover

    Can support larger databases than MySQLCluster

    Can be extended with the rest of the

    application stack in the same Cluster. MySQLCluster has no framework to integrateapplications

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    15/42

    15

    USE IMPROVE EVANGELIZE

    Open HA Cluster Benefits cont.

    The Open HA Cluster MySQL agent leveragesall the rich infrastructure features of Open HACluster (strong membership, dependencies,...)

    Can support Campus and Metro Clusters up to700 km

    Supports MySQL replication in all its flavors

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    16/42

    16

    USE IMPROVE EVANGELIZE

    Open HA Cluster Stack

    Operating

    System

    ClusterInfrastructure

    Agents

    Applications

    Heartbeats

    Membership

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    17/42

    17

    USE IMPROVE EVANGELIZE

    HA FailoverServiceApplication failoverWithin nodes or

    containerContainers failoverFailover ofvolumes/filesystemsFailover IP address

    Failover Service

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    18/42

    18

    USE IMPROVE EVANGELIZE

    ScalableService

    Software LoadBalancing

    Global Network ServiProvides Global IP addrwith failure protection

    Scalable Service

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    19/42

    19

    USE IMPROVE EVANGELIZE

    Apache(Scalable)

    Global Network ServiProvides Global IP addrwith failure protection

    MySQL (Failover)

    Example: Apache andMySQL

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    20/42

    20

    USE IMPROVE EVANGELIZE

    Heartbeats

    Membership

    Quorum

    Disk Fencing Resource GroupManagerResource (application)dependenciesInter RG dependenciesRG affinities

    HA FailoverServiceApplication failoverWithin nodes or

    containerContainers failoverFailover IP address

    Global FileService

    Failover File

    ScalableService

    Software LoadBalancing

    Global Network ServiProvides Global IP addrwith failure protection

    Monitoring

    Solaris Cluster ArchitectureQuorumServer

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    21/42

    21

    USE IMPROVE EVANGELIZE

    Open HA Cluster and Virtualisation

    Cluster control is in the global zone

    Failover xVM

    Failover Container

    Zone Nodes

    Cluster control is in the virtualization entity

    Cluster in LDOMS

    Zone Cluster

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    22/42

    22

    USE IMPROVE EVANGELIZE

    Cluster Agents

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    23/42

    23

    USE IMPROVE EVANGELIZE

    Open HA Cluster Stack

    Operating

    System

    ClusterInfrastructure

    Agents

    Applications

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    24/42

    24

    USE IMPROVE EVANGELIZE

    Cluster Agents (Data Services)

    Applications run on cluster unmodified(off-the-shelf if it complies to some rules)

    Cluster Agents are the glue layer

    between applications and clusterinfrastructure

    Application cannot break into the highavailability business on Solaris Cluster

    without an agent!

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    25/42

    25

    USE IMPROVE EVANGELIZE

    MySQL (Shared Disk)

    MySQL

    StorageLog. Host

    Node1(:Zone1)

    Node2(:Zone2)

    Client

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    26/42

    26

    USE IMPROVE EVANGELIZE

    MySQL (Replicated Disk) Global Zone

    MySQL

    StorageLog. Host

    Node1 Node2

    Storage based replicationTruecopySRDF

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    27/42

    27

    USE IMPROVE EVANGELIZE

    MySQL (Shared Disk) Master - Slave

    Node1 :Zone1Node1 :

    Zone3

    Node2 :Zone2Node2 :

    Zone4

    MySQL2

    StorageLog. Host

    MySQL1

    StorageLog. Host

    Mys Repl

    Client

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    28/42

    28

    E

    MySQL (Shared Disk) Failover Zone

    MySQL

    StorageLog. Host

    Node1 Node2

    Zone1

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    29/42

    29

    E

    MySQL (Shared Disk) Zone Cluster

    StorageLog. Host

    Node1:Zon

    e-cl

    Node2:Zon

    e-cl

    MySQL

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    30/42

    30

    E

    MySQL (Shared Disk) Multiple Clusters

    MySQL

    Storage Log. Host

    Node1 (Zone) Node2 (Zone)

    MySQL

    Storage Log. Host

    Node3 (Zone) Node4 (Zone)

    MySQL Replication

    Cluster 1 Cluster 2

    USE IMPROVE EVANGELIZ

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    31/42

    31

    EMySQL (Shared Disk) replication outsidea cluster

    MySQL

    Storage Log. Host

    Node1 (Zone) Node2 (Zone)

    Node3 (Zone)

    MySQL Replication

    Cluster 1

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    32/42

    32

    E

    Geographic ClusteringMulti-Cluster and Multi-Site capability

    Site 1

    Admin.Client

    UserClient

    Site 2

    Optionalheartbeat networks

    Optional storage network

    StorageStorage

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    33/42

    33

    E

    MySQL and Open HA

    ClusterFuture Configurations

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    34/42

    34

    E

    Solaris Cluster / OHAC FutureBenefits

    Can give the option to use MySQL replicationas a replacement for shared storage

    Can be extended to a full DR solution usingMySQL replication as the replication protocol

    Can do loadbalancing between scalable slaves

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    35/42

    35

    E

    Solaris Cluster / OHAC FutureBenefits cont.

    Can be extended to integrate the rest of theMySQL features like MySQL Cluster

    Can leverage the Shared Address resourcetype to do load balancing for SQL nodes

    USE IMPROVE EVANGELIZE

    G hi Cl t i

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    36/42

    36

    E

    Geographic ClusteringMulti-Cluster and Multi-Site capability

    Site 1

    Admin.Client

    UserClient

    Site 2

    Optionalheartbeat networks

    Optional storage network

    StorageStorage

    MySQL replication is

    available soon

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    37/42

    37

    E

    MySQL Scalable Slaves

    Shared Addr.

    MySQL replication

    MySQL-Slave

    Storage

    MySQL-Slave

    Storage

    MySQL-Master

    Storage Log. Host

    Loadbalancer

    Client

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    38/42

    38

    E

    MySQL Scalable Slaves

    Shared Addr.

    Node2(:zone2)

    Node1(:zone1)

    MySQL replication

    MySQL-Slave

    Storage

    MySQL-Slave

    Storage

    MySQL-Master

    Storage Log. Host

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    39/42

    39

    E

    MySQL Shared Nothing (future)

    Rolechanger

    Log. Host

    Node2 :Zone2 Slave

    Node1 : Zone1 Master

    Quorum

    Server

    MySQL-P MySQL-SMySQL replication

    USE IMPROVE EVANGELIZE

    MySQL Cluster (Shared Nothing)

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    40/42

    40

    MySQL Cluster (Shared Nothing)Local/Global Zone (future)

    SQL-Node

    Data-NodeData-Node

    Data-Node

    Data-Node

    SQL-NodeSQL-Node

    logh hsp

    Mys queryNode5,6,7

    logh hsp

    Mys queryNode5,6,7

    logh hsp

    Mys queryNode5,6,7

    logh hsp

    Mys mgtNode 6,7

    ...

    hsp

    Mys dataNode1

    hsp

    Mys dataNode3

    hspMys data

    Node4hsp

    Mys dataNode2

    Shared Addr

    USE IMPROVE EVANGELIZE

  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    41/42

    41

    ReferencesCluster References

    http://www.opensolaris.org/os/community/ha-clusters/ohac/

    http://www.opensolaris.org/os/project/ha-mysql/

    http://docs.sun.com/app/docs/prod/sun.cluster32#hic

    Blogs

    http://blogs.sun.com/sc/

    http://blogs.sun.com/krishs/entry/deployment_and_failover_study_of

    Blueprints

    http://wikis.sun.com/display/BluePrints/High+Availability+MySQL+Database+Replication+with+Solaris+Zone+Cluster

    http://www.opensolaris.org/os/community/ha-clusters/ohac/http://www.opensolaris.org/os/project/ha-mysql/http://docs.sun.com/app/docs/prod/sun.cluster32#hichttp://blogs.sun.com/sc/http://blogs.sun.com/krishs/entry/deployment_and_failover_study_ofhttp://wikis.sun.com/display/BluePrints/High+Availability+MySQL+Database+Replication+with+Solaris+Zone+Clusterhttp://wikis.sun.com/display/BluePrints/High+Availability+MySQL+Database+Replication+with+Solaris+Zone+Clusterhttp://blogs.sun.com/krishs/entry/deployment_and_failover_study_ofhttp://blogs.sun.com/sc/http://docs.sun.com/app/docs/prod/sun.cluster32#hichttp://www.opensolaris.org/os/project/ha-mysql/http://www.opensolaris.org/os/community/ha-clusters/ohac/
  • 7/31/2019 Solutions for High Availability and Disaster Recovery With MySQL

    42/42

    USE IMPROVE EVANGELIZE

    Thank you!

    Detlef [email protected]

    open artwork and icons by chandan:http://blogs.sun.com/chandan

    http://blogs.sun.com/chandanhttp://blogs.sun.com/chandan