Advanced HA and DR מי אני? עידו פרידמן יועץ ומדריך SQL Server בחברת מוביל טכנולוגי של תחום SQL ואלינור Ido@Valinor.co.il 1
ואלינור החברה המובילה בישראל במתן שירותים מקצועיים בתחום בסיסי נתונים צוות יועצים מוביל המתמחה בכלל הרבדים של בסיסי הנתונים שותפים ברמת זהב של Microsoft ו- Oracle נציגי מוצרים מובילים בתחום בסיסי הנתונים מעל 300 לקוחות בכל המגזרים http://www.valinor.co.il ואלינור 2
Agenda 09:00-10:30 SQL Server and HA 10:30-10:45 Break 10:45-12:30 Hands on LAB (Cluster, log shipping and replication) 12:30 13:30 Launch 13:30 15:00 What is Always ON + LAB 15:00 15:15 Break 15:15 16:15 Replication in real life (Maria Zakourdaev) 15:15 16:30 - Summary מתחילים 3
DRP Uptime Number of 9 s Availability Percentage Total Annual Downtime 2 99% 3 days, 15 hours 3 99.9% 8 hours, 45 minutes 4 99.99% 52 minutes, 34 seconds 5 99.999% 5 minutes, 15 seconds 4
Disaster recovery plan RTO (Recovery time objective) Scope of disaster RPO (Recovery point objective) DRP Scale out ROI 5
Business continuity Provide DR and HA to business critical services ONLY SQL Server HA and DR 6
What needs protection Where do we recover HA LAN DR Synchronous WAN Asynchronous 7
SQL Server components DB engine Full text Search Reporting services SQL Server SQL Server Agent Analysis Services Integration Services SQL Server component session state Stateful Stateless Database engine SQL server agent Analysis services Full-text search Reporting services Integration Services 8
Solutions SQL 2008 Solutions SQL 2012 9
Fail Over Cluster instance Solution Level Instance Pros Very low failover time No affect on the application Supported on standard edition WSFC can be used for other HA needs Cons Requires shared storage Complex AD required FCI How does it work FCI Elements Service management Storage Management Network Management Automatic control of SQL services Clustered Disk Virtual Server Virtual IP 10
FCI How does it work Instance A Instance B Instance C Active Failover Active Active FCI What s new in SQL2012 Multi site support Enhanced health checks Failover policies tempdbon local storage 11
Multisite FCI FCI DEMO 12
Mirroring Solution Level Mirroring Pros Cons Synchronous or Asynchronous Automatic failover Limited access to mirror Database Share nothing solution Does not require AD Client side failover 13
Mirroring How does it work Mirroring Elements Sync type Servers High safety High safety with auto failover High performance Primary Mirror Witness Mirroring How does it work Principal Mirror 14
Log Shipping Log Shipping Solution Level Database Pros Multiple Copies Delayed copy of data Very simple implementation Cons Limited access to copies Client side failover Limited Fail back 15
Physical DB Structure Data file:.mdf or.ndf Log file:.ldf Extent: 8 contiguous 8KB pages Page: 8KB SQL Server backups Full Backup Transaction log Sunday Monday 16
Log shipping How does it work Log shipping Elements Servers Databases Jobs Primary server Secondary server Monitor Server Primary Database Secondary Database Backup Copy Restore Log shipping How does it work 17
Log shipping DEMO Solution Level Replication Pros High Granularity Cons Complex Object R/W copy of data Low latency data sync Client side failover Requires maintenance Affects data and structure 18
Transactional Replication How does it work Transactional Replication Elements Servers Objects Agents Publisher Subscriber Distributor Publication Article Log reader Snapshot Distribution Transactional Replication How does it work 19
Transactional replication DEMO What happens when Business requirements are: Automatic failover Of multiple databases together With no single point of failure Redundancy across multiple datacenters 20
SQL Server 2008 R2 or prior Mirroring Log shipping Cluster No single solution Replication SQL Server 2012 21
Solution Level Always ON Availability Group Pros Cons Multi database solution Sync or Async Listener Enterprise edition only Availability Group Multiple secondaries Read Only secondaries Low latency failover More.. Requires AD Cluster Log shipping Replication 22
SQL Server 2012 Always On Availability Groups A A A A What happens when Business requirements are: Automatic failover Of multiple databases together With no single point of failure Redundancy across multiple datacenters 23
SQL Server 2008 R2 or prior Database mirroring provides automated failover of a single database Redundant copies of the database exist on principle and mirror server Failing over multiple databases at the same time requires custom code Application failover is accomplished through the use of FailoverPartner connection string value SQL Server 2012 Always ON AG up to four copies of the databases Synchronously or Asynchronously Multiple-database failover is handled automatically by the Availability Group Application failover through the Availability Group Listener and Application Virtual Name 24
Availability group architecture WSFC role in AG Mixed synchronous and asynchronous in one AG Inter-node health detection Failover coordination Primary health detection Distributed data store for settings and state Distributed change notifications between nodes Replaces multiple technology implementations in a single solution Support for up to three synchronous replicas, one primary and two secondaries Support for multiple Availability Groups with separate failure paths for different applications Architecture availability group failover Clients connect to primary replica through the Availability Group Listener virtual name A failover is initiated using WSFC Manager SQL-AG1 confirms failover and informs WSFC WSFC tells the AG resource DLL to bring SQL-AG1 offline Clients are disconnected from SQL-AG1 WSFC tells the AG Resource DLL to bring SQL-AG2 online Availability Group Listener Virtual Name resource moves to SQL- AG2 and brought online by WSFC Clients are automatically redirected to SQL-AG2 through the Availability Group Listener virtual name WSFC provides notification of the new primary server to all secondary replicas Secondariesreconnect to the new primary replicas mirroring endpoint and synchronization resumes Availability Group Listener 25
Always ON Availability Group DEMO Always ON AG Summary SQL Server 2012 offers higher availability and disaster recovery Up to four secondary replicas Combination of synchronous and asynchronous replicas Choice of automatic or manual failover modes SQL Server 2012 offers more flexibility for configuring your HA/DR topology Ability to read from secondary replicas Groups of databases can fail over together, removing need for complex logic Broad cross-feature support, including FILESTREAM, RBS, FILETABLE, and Service Broker 26
27 Always ON Availability Group
SQL HA And Virtualization YES Common mistakes FCI and Virtualization No need for SQL HA ITS OK to virtualize SQL Server Over sharing resources Supported with limitations Highly complicated deployments Reduce planed downtime Windows Server core Online Operations Rolling Upgrade and Patching 28
SQL HA and the cloud PaaS IaaS SaaS SQL Azure Amazon RDS Amazon EC2 Windows Azure Office 365 Sales Force SQL HA and the cloud The cloud is not bullet proof Planed down time still occur Check what site level protection is provided Check you SLA 29
Upgrading HA to SQL 2012 SQL Serverfailover clustering Log shipping Mirroring Failover Cluster instance Log shipping AlwaysON AG Summary Feature/Tech. Cluster Mirror Log shipping Replication Always ON AG Automatic failover + + - - + Transparent client redirect + - - - + Scope of protection Instance DB DB Object AG Number of database copies 1 2 Multiple Multiple Multiple Geo scope LAN* LAN/WAN LAN/WAN LAN/WAN LAN/WAN Shared storage required + - - - - Database level filter - + + + + Object level filter - - - + - Active / Active ~ Limited Limited + Read only 30
Summary Feature/Tech. Cluster Mirror Log shipping Replication Always ON AG Data loss potential Non Non* Medium Medium Non* Database changes required - - - + * In Synchronized mode (high-protection) Summary Identify Business needs Select correct solution Test and implement solution Achieve HA 31
32