Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

32
SQL Server AlwaysOn for Dummies Mark Broadbent SQLCloud SQLCLOUD.CO.UK

description

 

Transcript of Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Page 1: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

SQL Server AlwaysOn for Dummies

Mark Broadbent SQLCloud SQLCLOUD.CO.UK

Page 2: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Agenda

Windows Server Failover Clustering

AlwaysOn Availability Groups

AlwaysOn Failover Clustered Instances

Introduction to AlwaysOn

3

2

1

4

Page 3: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

About

Mark Broadbent “30 billion times more intelligent than a live mattress”

• Email: [email protected]

• Twitter: retracement

• Blog: http://tenbulls.co.uk

• Event Lead to the UK’s first ever SQLSaturday (Cambridge)

http://www.sqlsaturday.com/events.aspx

• Cambridgeshire PASS Chapter UG Leader http://sqlcambs.org.uk

Page 4: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Introduction to AlwaysOn

Page 5: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

AlwaysOn Technologies*1

*1 According to my interpretation!

AlwaysOn Availability Groups

AlwaysOn Failover Clustered Instances

Database Mirroring

Scalable Shared Database

Replication

Page 6: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

AlwaysOn is…

Page 7: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

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 not a consideration

BUT

• Shared data with single point of failure per instance.

• Complex to administrate

Page 8: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

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.e user error – deletion of records) • Complex (arguably less than FCI) to administrate • Instance level components not failed over –contained

dbs partially come to the rescue

Page 9: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Dr. Evil Senior Microsoft Windows Clustering Program Manager

Page 10: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Don’t let the terms confuse you!

Cluster Node Cluster Server

Node Server

Cluster Group Role

Service or Application Virtual Server

Failover Cluster Clustered Instance

SQL Server Server

Resources (take your pick)

Quorum

Client Network

Private Network Interconnect

Internal Network

Public Network... LAN

SAN

Shared Storage

Disk

Cluster Storage

Active/Passive

Single Instance Multi Instance

N+n Cluster

Majority

Votes

Page 11: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Windows Server Failover Clustering

Page 12: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

“The Magic” of Clustering

Clustered

“Application”

Cluster Nodes

failover

Page 13: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

“The Magic” of Clustering

Clustered

“Application”

Cluster Nodes

failover

Page 14: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

“The Magic” of Clustering

Clustered

“Application”

Cluster Nodes

Page 15: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Storage

Network

Internal

Network

A Basic Windows Cluster

Public

(or Client) Network

Shared

(or Asymmetric) Storage

Quorum The Cluster

Group

Cluster Node

Cluster Service

Page 16: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Understanding Quorum I’m

Alive!

Page 17: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Quorum Models

Node majority (no witness)

Node majority with witness (disk or file share)

No majority (disk witness only)

+Node weighting Dynamic weighting -new to Windows 2012

Page 18: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

DEMO

Taking a look at our Cluster

Page 19: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

AlwaysOn Failover Clustered Instances

Page 20: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Installation

Page 21: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Clustered Instances

failover Node A Node B

SQL Server Instance A

Role (formerly known as Cluster Group)

Network Name

Page 22: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Clustered Instances

Node A Node B

SQL Server Instance A

Role (formerly known as Cluster Group)

Network Name

Page 23: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

AlwaysOn Availability Groups

Page 24: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Availability Group consists of…

Listener

Availability Group

Resource

Availability Group

Databases

Replica/s

Instance Components Cluster Resources

Page 25: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Availability Groups

Transaction Logs

Availability Group

SQL Server Instance A

Transaction Logs

Redo

Sync/ Async

Secondary Replica

SQL Server Instance B

Listener

Page 26: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Readible Secondaries

• 5 replicas

• 2 synchronous, others aysnchronous

• 1 Read/ Write

• 4 either Readonly, Read-Intent or No Access

Page 27: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

ReadOnly Routing

• Set connection string property ApplicationIntent=ReadOnly

• Must connect to a listener.

• Modify Secondary Replica Roles with read only routing url.

• Modify Primary Replica Roles with read only routing list.

Page 28: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

DEMO

Using AlwaysOn

Page 29: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

Installing to Server Core

Page 30: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

[Session Code]

Page 31: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02
Page 32: Sqlserveralwaysonfordummiessqlsantaedition 121218144206-phpapp02

In Summary…

• It is not all Butterflys and Unicorns so choose the HA solution appropriate to your requirements.

• Failover Clustering is a very mature technology but requires specialist skill and understanding. It does not provide scalability.

• Availability Groups partially rely on Windows Clustering but are slightly easier to setup and manage. They also provide reporting query scalability.