clustering sql server tom pullen senior dba, rm education [email protected]

25
Clustering SQL Server Tom Pullen Senior DBA, RM Education [email protected]

Upload: leo-dickerson

Post on 28-Dec-2015

223 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Clustering SQL Server

Tom Pullen Senior DBA, RM Education

[email protected]

Page 2: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Agenda

Why Cluster?Is it worth the hassle and expense?How does it compare to other HA technologies?

How to Clusterplanprepareexecutetest/monitor

Page 3: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Why Cluster?

High availability requirements – 24X7, patching, hotfixes

Cost and Benefit

Requirements: hardware, software, licenses

Alternatives: comparing clustering with other HA technologies

Limitations – what does clustering not protect you from?

Combining clustering with other HA technologies – log shipping, mirroring, offloading reporting load

Page 4: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

How to cluster

Plan

Prepare

Execute

Test

Page 5: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Plan1. Consult your users/boss/finance director!2. Design your cluster: Nodes, Instances, Storage3. Write a plan for build4. Write a plan for migration/go-live5. Think of everything!6. Get your plans and design peer-reviewed7. Think about failure – how to go back?8. Plan decision points – when/if to proceed, or give

up & the points of no return

Page 6: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Prepare

Do everything you can in advance

- create security accounts

- obtain/reserve IP addresses

- obtain install media – and SP install files

- ensure you accurately estimate the time requirements – be conservative!

- plan downtime, advertise downtime, arrange holding pages

- think about all the other things you normally need on a new server:

logins, jobs, configs, SPs, backup software, backup location, tapes?, database mail, alerts etc!

Page 7: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Execute

Print your planFollow itMark your progressGive yourself incentives!Publicise your progressGet help if you encounter problemsBe willing to give up if necessary

Page 8: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Steps in clusteringBuild servers, OS, AD, networking, SAN/LUN presentation [or

have this done for you] – check everything!Install/configure MSDTCInstall clusteringCreate cluster groupsCluster MSDTCTest failoverInstall SQL Server instance(s)Service Pack/Hotfix/Cumulative Update(s)ConfigureDo all the other normal things! (Jobs, logins etc)Test failover and failure

Page 9: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

MSDTCMSDTC – Under Windows 2003, it is a pain

MSKB docs can be misleadingHow to enable network DTChttp://support.microsoft.com/kb/817064How to cluster MSDTChttp://support.microsoft.com/kb/301600

Enable network DTC on each node and set permissions BEFORE clustering

Under Windows 2008/SQL Server 2008, things are much improved!

If you get into a tangle clustering MSDTC, it is sometimes quicker to strip everything out (cluster .. /forcecleanup) and start again!

Clustering itself is easier than getting MSDTC right!

Page 10: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Cluster!

Shut down all but the first nodeCluster Administrator → new clusterEnter name, IP, Quorum diskSwitch on other server(s) and add them to the clusterConfigure heartbeat network

Create cluster groups and disk resources ready for SQL Server to install into

Page 11: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Cluster Administrator

Page 12: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

A group before SQL Server is installed

Page 13: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

cluster.exe command example

CLUSTER /CLUSTER:SQLCLUS01 GROUP "BACKUP1" /CREATECLUSTER /CLUSTER:SQLCLUS01 GROUP "BACKUP1" /ONLINECLUSTER /CLUSTER:SQLCLUS01 GROUP "BACKUP1" /SETOWNERS:SQL05CLUSTER /CLUSTER:SQLCLUS01 RESOURCE "LUN U_BAK" /CREATE /GROUP:"BAK_SHARE" /TYPE:"Physical Disk" /PRIV DRIVE="U:" /OFFLINECLUSTER /CLUSTER:SQLCLUS01 RESOURCE "LUN U_BAK" /ONLINECLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup IP Address Public" /CREATE /GROUP:"BACKUP1" /TYPE:"IP Address" /PRIV ADDRESS="194.168.190.44" /PRIV SUBNETMASK="255.255.255.0" /PRIV NETWORK="Public" /OFFLINECLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup Network Name Public" /CREATE /GROUP:"BACKUP1" /TYPE:"Network Name" /PRIV NAME="SQLCLUS01BAK" /OFFLINECLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup Network Name Public" /ADDDEPENDENCY:"Backup IP Address Public"CLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup Network Name Public" /PRIV RequireKerberos=0CLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup_Share" /CREATE /GROUP:"BACKUP1" /TYPE:"File Share" /PRIV SHARENAME="BACKUPS1" /PRIV PATH="U:\" /OFFLINECLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup_Share" /ADDDEPENDENCY:"Backup Network Name Public"CLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup_Share" /ADDDEPENDENCY:"LUN U_BAK"CLUSTER /CLUSTER:SQLCLUS01 RESOURCE "Backup_Share" /PRIV Security="Everyone",set,C:securityCLUSTER /CLUSTER:SQLCLUS01 GROUP "BACKUP1" /OFFLINECLUSTER /CLUSTER:SQLCLUS01 GROUP "BACKUP1" /ONLINE

Page 14: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Install SQL Server Instance(s)Run setup!Do you like unattended installs/batch files?SQL Server 2005 runs multiple times automatically on each node using Task SchedulerSQL Server 2008 must be installed on each node

Interactive install of SQL Server requires you to specify:-

Components to installInstance Name, Virtual Server Name + IP, Cluster Group, Cluster Node ConfigurationSetup account infoService accountDomain group for cluster servicesAuthentication modeCollationError usage & reporting

Unattended install requires you to specify all of these in the config fileDo it all over again for each instance!

Service pack – does each engine instance on each node. Must be run from active node.Don’t forget to Service Pack Tools, Shared Components, SSIS, SSNAC/connectivity, etc

Page 15: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Install SQL Server Instance(s)

Page 16: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Now make your instance like you normally would!

Configure! RAM especially. Think about min, max, what can be where?MAXDOP? Max worker threads?

LoginsJobsAlertsDatabase MailSPs in system DBs?Startup SPsTrace FlagsAuditingMaintenanceSysmessages? Static data? Resize system DBs? Move/split tempdb files?Any other things that are particular to your environment

Page 17: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Test!

Test failoverTest failureFix issuesRun each instance on every Node it can exist

on and check it is ok

Page 18: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Migrate

Get your User DBs on – migrate or create?Populate(Re)point your appsTest your appsAnything else? (Replication?)Reporting services? Analysis Services?

Page 19: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Monitor

Enable alertsFailover – startup SP?Monitor performanceMonitor availablilityMonitor disk spaceMonitor your monitor!

Page 20: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Some real-world clusters

Page 21: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Some real-world clusters

Page 22: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Some real-world clusters

Page 23: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Some real-world clusters

Page 24: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Summary

Failing to plan is planning to failWrite your plan – and follow it!Don’t be scared of clusteringKnow where to find helpPractice if you can with test serversDon’t panic! But feel free to curse MSDTC...

Page 25: Clustering SQL Server Tom Pullen Senior DBA, RM Education tpullen@rm.com

Good ResourcesHow to cluster Windows 2003http://www.sql-server-performance.com/articles/clustering/cluster_server_2003_p1.aspx

How to cluster SQL Server 2005http://www.sql-server-performance.com/articles/clustering/cluster_sql_server_2005_p1.aspx

MSDN Clustering Bloghttp://blogs.msdn.com/clustering/

Windows 2008 Clustering Step-By-Stephttp://technet.microsoft.com/en-us/library/bb727114.aspx

Windows 2003 Microsoft White Paper (comprehensive!)http://www.microsoft.com/downloads/details.aspx?familyid=96F76ED7-9634-4300-9159-89638F4B4EF7&displaylang=en