SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition

3,112 views

Published on

Welcome to Microsoft's world of the buzzword. Yes, they've done it again and created another ambiguous term that no one really understands. AlwaysOn is a powerful group of highly available technologies, and in this presentation, we will delve into their murky world & reveal the technology behind the buzz. Focusing specifically on the two key components of SQL Server 2012 AlwaysOn in Failover Clustered Instances and Availability Groups, we will investigate their pre-requisites, setup, administration, use & drawbacks. We will look at: Using Windows 2008, 2012 and Server Core Windows Clustering Quorum Failover Clustered Instances Availability Groups Readable Secondaries Clustering Tools and PowerShell Dummies and higher are welcome.

Published in: Technology

SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition

  1. 1. SQL ServerAlwaysOn forDummiesMark BroadbentPrincipal SQL ConsultantSQLCloudSQLCLOUD.CO.UK
  2. 2. AboutMark Broadbent“Possibly the hardest drinking DBA on the planet”“30 billion times more intelligent than a live mattress”Email: mark.broadbent@sqlcambs.org.ukTwitter: retracementBlog: http://tenbulls.co.ukPASS UK Regional MentorEvent Lead to the UK’s first ever SQLSaturday (Cambridge)Event #2nd due on Friday 27th Sept 2013 (pre-con) 28th Sept (Community day)http://www.sqlsaturday.com/228/eventhome.aspxCambridgeshire PASS Chapter UG Leader http://sqlcambs.org.uk
  3. 3. SQLSaturday Cambridge 201327th (pre-con) and 28th (free) Septemberhttp://www.sqlsaturday.com/228Queen’s College, Cambridge CB3 9ETWhat is the air-speed velocity of an unladen swallow?
  4. 4. AgendaWindows ServerFailover Clustering& QuorumAlwaysOnAvailability GroupsAlwaysOn FailoverClustered InstancesIntroduction toAlwaysOn3214
  5. 5. Introduction to AlwaysOn
  6. 6. AlwaysOn Technologies*1*1 According to my interpretation!AlwaysOnAvailability GroupsAlwaysOn FailoverClustered InstancesDatabaseMirroringScalable SharedDatabaseReplication
  7. 7. “AlwAys On” isnae new!
  8. 8. Dr. EvilSenior MicrosoftWindows ClusteringProgram Manager
  9. 9. Don’t let the terms confuse you!Cluster NodeCluster ServerNodeServerCluster GroupRoleService or ApplicationVirtual ServerFailover ClusterClustered InstanceSQL ServerServerResources (take your pick)QuorumClient NetworkPrivate NetworkInterconnectInternal NetworkPublic Network...LANSANShared StorageDiskCluster StorageActive/PassiveSingle InstanceMulti InstanceN+n ClusterMajorityVotesAvailability GroupReplicaReadonly Replica
  10. 10. AlwaysOn Clustered Instances Provide…• Abstraction of SQL instance• High availability of Instance name• Instance and related services failover as a unit• Instance components such as jobs and logins nota consideration• Distributed Transaction SupportBUT• Shared data with single point of failure perinstance.• Complex to administrate
  11. 11. Availability Groups Provide…• Abstraction at the databases level• Failover as a single Unit• High availability of “Instance” (listener) name• All the benefits of DB Mirroring….and less of the problems (FS is supported)BUT• Connected replicas are potentially single point of failure (i.euser error – deletion of records)• Complex (arguably less than FCI) to administrate• Instance level components not failed over –contained dbspartially come to the rescue• No Distributed Transaction support for failover
  12. 12. AlwaysOn is…
  13. 13. Windows ServerFailover ClusteringThe foundation of AlwaysOn
  14. 14. “The Magic” of ClusteringClustered“Application”Cluster NodesThe “magic” of clustering is the ability for the cluster to ensure only one set of services,executables and resources are alive on one node for a clustered application at any one time.A clustered application will be installed onto each node
  15. 15. “The Magic” of ClusteringClustered“Application”Cluster Nodesfailover
  16. 16. “The Magic” of ClusteringClustered“Application”Cluster Nodesfailover
  17. 17. StorageNetworkInternalNetworkA Basic Windows ClusterPublic(or Client) NetworkShared(or Asymmetric) StorageQuorumThe ClusterGroupCluster NodeCluster Service
  18. 18. Understanding QuorumI’mAlive!
  19. 19. Quorum ModelsNode majority (no witness)Node majority with witness (disk or file share)No majority (disk witness only)+Node weightingDynamic weighting -new toWindows 2012
  20. 20. DEMOTaking a look at our Cluster
  21. 21. AlwaysOn FailoverClustered InstancesInstance Level High Availability
  22. 22. InstallationCreate and install your clusteredinstance on the first cluster nodeFor all other nodes installexecutables on every other node
  23. 23. Clustered InstancesNode A Node BSQL Server Instance ARole (formerly known asCluster Group)NetworkName
  24. 24. Clustered InstancesfailoverNode A Node BSQL Server Instance ARole (formerly known asCluster Group)NetworkName
  25. 25. AlwaysOnAvailability GroupsDatabase[s] Level High Availability
  26. 26. Availability Group consists of…Listener(Name andIP)AvailabilityGroupResourceAvailabilityGroupDatabasesSQL Instance Components Wndows Cluster ResourcesReplica/sAvailabilityCluster GroupMirroringEndpointsAvailabilityGroupListener(Name andIP)Do not flippin’ touch!
  27. 27. Transaction LogsSecondary ReplicaSQL Server Instance ATransaction LogsPrimary ReplicaSQL Server Instance AAvailability GroupsTransaction LogsRedoSync/ AsyncSecondary ReplicaSQL Server Instance BListener
  28. 28. Transaction LogsSecondary ReplicaSQL Server Instance AAvailability GroupsTransaction LogsSync/ AsyncSecondary ReplicaSQL Server Instance BListenerRedoTransaction LogsPrimary ReplicaSQL Server Instance B
  29. 29. Availability Groups and Readable Secondaries• 5 Replicas• 2 Synchronous, others Asynchronous• 1 Read-Write• 4 either Read-only, Read-Intent or No Access
  30. 30. DEMOUsing AlwaysOn
  31. 31. ReadOnly Routing• Set connection string propertyApplicationIntent=ReadOnly• Must connect to a listener.• Modify Secondary Replica Roles with readonly routing url.• Modify Primary Replica Roles with read onlyrouting list.
  32. 32. In Summary…• It is not all Butterflys and Unicorns so choose theHA solution appropriate to your requirements.• Failover Clustering is a very mature technologybut requires specialist skill and understanding. Itdoes not provide scalability.• Availability Groups partially rely on WindowsClustering but are slightly easier to setup andmanage. They also provide reporting queryscalability.
  33. 33. Tha mo bhàta-foluaimein loma-làn easgannanfor attending this session andSQLSaturday #202 in EdinburghThank you!

×