Está en la página 1de 52

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

TI LIU CI T SQL 2008 FAILOVER CLUSTER TRN WINDOWS SERVER 2008 R2 FAILOVER CLUSTER

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 1

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


NI DUNG

I. II. III.

Cu hnh RAID Server IBM x3950 (8878-2RA) ............................................ 3 Ci t H iu hnh cho Server .......................................................... 12 Cc bc chun b .............................................................................. 18

1. Danh sch a ch IP ........................................................................... 18 2. Danh sch a dnh cho Cluster Windows v Cluster Sql 2008 ............. 18 3. Yu cu khc ...................................................................................... 19 IV. Ci t v cu hnh Failover Cluster windows 2008 R2 ........................... 19

1. Ci t Application Server Role: ........................................................... 19 2. Ci t Failover Clustering Feature ....................................................... 23 3. To mt Failover Cluster...................................................................... 26 4. Cu hnh Cluster Quorum .................................................................... 33 5. Ci t MsDTC .................................................................................... 36 V. Ci t SQL 2008 R2 Failover Cluster ...................................................... 39 1. Ci t SQL 2008 Failover Cluster trn mt Node .................................. 39 2. Thm Node vo SQL 2008 Failover Cluster ............................................ 50

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 2

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


I. Cu hnh RAID Server IBM x3950 (8878-2RA) Note: Vi Server IBM x3950 8878-2RA ny, chng ta khng th dng a Server Guide ca IBM cu hnh RAID nh thng thng. Chng ta s cu hnh RAID cho Server vi giao din DOS. Khi ng Server IBM x3950, khi mn hnh ang mn hnh khi ng ch ti mn hnh nh bn di Nhn Ctrl + S

Sau chng ta nhn Ctrl + A tin vo qu trnh cu hnh RAID

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 3

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Sau l mn hnh khi ng ch IBM ServerRAID 8i Controller

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 4

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


u tin chng ta di chuyn xung chn Disk Utilities kim tra xem nhng a no hu dng cho vic s dng

Hnh bn di cho thy danh sch nhng a hu dng cho s dng

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 5

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Sau nhn Esc thot ra mn hnh ban u v chn Array Configuration Utility

Trong ca s Main Menu Chng ta chn Initialize Drivers khi to li a t ban u

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 6

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Danh sch a hin th cho php chng ta chn nhng a khi to. S dng du Space chn nhng a cn khi to.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 7

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Sau khi chn a khi to, bn khung Selected Drivers s hin th danh sch cc c chn.

Sau khi nhn Enter kt thc qu trnh chn a khi to, c cnh bo s xa ht thng tin trn cc a c a ra nh hnh di. Chng ta ng v nhn Y

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 8

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


V qu trnh khi to cc a c chn v trng thi khng d liu din ra

Sau khi khi to xong tt c cc a, h thng s t ng chuyn sang bc Create Array

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 9

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Chn cc m chng ta mun nhm vo Array to mi. y chn c 4 a tn ti

Thng tin ca Array v loi RAID m chng ta chn cho vic cu hnh my ch ny.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 10

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Cui cng chng ta thot khi ch cu hnh RAID cho Server bng cch chn Yes ca s sau.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 11

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


II. Ci t H iu hnh cho Server Cho a ci t c cha b ngun H iu hnh Windows Server 2008 R2 vo my ch.

Khi ng li my v chn ch Boot t CD DVD my ch nhn dng a ci t v tin hnh ci t

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 12

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong ca s ban u vi cc thit lp v Ngn ng (Language), Thi gian (Time), Ngn ng bn phm hoc phng php truyn (Keyboard or input method) Mc nh chn Next

Ca s tip theo, tin hnh ci t chng ta chn Install Now

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 13

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Chn phin bn H iu hnh m chng ta ci t cho Server

Ca s tip theo chn I accept the license terms ri chn Next

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 14

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Chn kiu ci t m chng ta mun s dng y chn ci mi Custom (Advanced)

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 15

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Hin th a chng ta mi khi to trong qu trnh RAID

C th chia thnh cc khc nhau, y to a cha H iu hnh dung lng 100Gb

Sau khi Apply chn a ri nhn Next B Cng Thng MOIT Nguyn Vn c NCSTech

Page 16

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Tip theo qu trnh ci t H iu hnh s t ng din ra, khi hon thnh s t ng khi ng li server v hon thnh qu trnh ci t.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 17

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

III.

Cc bc chun b

1. Danh sch a ch IP
Cn ti thiu 5 a ch IP cho qu trnh ci t SQL Cluster (2 Nodes) SQL01 v d: 192.168.70.89 / 24 (Public Address) 10.0.0.89 / 8 (Private Address) SQL02 v d: 192.168.70.90 / 24 (Public Address) 10.0.0.90 / 8 (Private Address) ClusterDatabaseIP ClusterWindowsIP ClusterMsdtcIP v d: 192.168.70.91 / 24 v d: 192.168.70.92 / 24 v d: 192.168.70.93 / 24

2. Danh sch a dnh cho Cluster Windows v Cluster Sql 2008


To 3 Vdisk trn SAN ln lt: Quorum (2Gb): Lu cu hnh ca Cluster Windows Msdtc [MS Distributed Transaction Coordinator] (3Gb): Lu cc transactions ca SQL Database.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 18

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Database(10Gb): Lu d liu

3 Vdisk ny s c mount ln lt ln cc my ch SQL_Server nh hnh bn di

3. Yu cu khc
H thng phi c Domain Controller v DNS Server c trin khai trc Join cc my ch mun ci Cluster vo Domain To 1 Security Group (sqlservice) lm member ca Group Administrator v cha user sqluser y l user dng chy cc services ca SQL Mi Node cn c ti thiu 2 card mng: Public (Kt ni mng Lan, cc Server khc v Clients truy cp vo), Private (dng cho lin kt heartbeat gia cc Nodes) H iu hnh windows s dng cho cc Nodes phi l Windows 64bit, phin bn

Enterprise
IV. Ci t v cu hnh Failover Cluster windows 2008 R2 Sau khi hon tt vic t tn v IP tng ng cho cc card mng, join domain cho cc Nodes. Ta tin hnh ci t ln lt cc Roles (Application Server), Feature (Failover Clustering), Service cho mi Node nh bn di.

1. Ci t Application Server Role:


M giao din Server Manager v chn Roles. Nhn chut vo Add Roles, giao din Add Roles s hin ra. B Cng Thng MOIT Nguyn Vn c NCSTech

Page 19

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Server Roles, chn Application Server. Mt hp thoi xut hin yu cu bn Add Required Features cho Application Server Role. Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 20

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Application Server. Nhn Next. Trong hp thoi Role Services, chn Incoming Remote Transactions v Outgoing Remote Transactions. Nhng options ny s c dng cho MSDTC. Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 21

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Confirmation, nhn Install. Qu trnh ci t s din ra.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 22

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Nhn Close trong hp thoi Results hon tt qu trnh ci t. Lm tng t cc bc cho Node cn li

2. Ci t Failover Clustering Feature


M giao din Server Manager v chn Features. Nhn chut vo Add Features, giao din Add Features s hin ra

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 23

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Features, chn Failover Clustering v nhn Next.

Trong hp thoi Confirmation. Nhn Install xc nhn la chn v chy tin trnh ci t Failover Cluster Feature.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 24

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Results, nhn Close hon tt ci t cho mt Node

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 25

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Lm tng t cc bc cho Node cn li.

3. To mt Failover Cluster
M giao din Failover Cluster Manager, bn di mc Management, nhn vo ng dn Create a cluster

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 26

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Select Servers, chn Browse v chn cc hostname tng ng cc Node cn cu hnh Failover Cluster (v d: sql01.moit.local v sql02.moit.local). Lu : C th ci t Cluster windows cho Domain Controller nhng khng ci c Cluster SQL, tn cc Node Server c dng minh ha v c th khc trong thc t.

Trong hp thoi Validation Warning, chn No, I do not require support from Microsoft for this cluster, and therefore do not want to run the validation tests. When I click Next, continue creating the cluster v nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 27

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Access Point for Administering the Cluster, nhp vo thng tin Hostname (V d: Sqlcluster-moit) v IP (V d: 192.168.70.92 / 24)

Trong hp thoi Confirmation, nhn Next. Tin trnh ci t Failover Clustering trn c 2 Node s c thc hin, to thm cc d liu ca Cluster trong DNS v AD

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 28

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Summary, xem li cc thng tin v Cluster c ci t thnh cng. Nhn Finish hon tt. B Cng Thng MOIT Nguyn Vn c NCSTech

Page 29

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Sau khi to xong mt Cluster, ta cn phi Validate li cc thng tin cho cu hnh trc khi c th ci cc ng dng. Phi chc chn rng cc bc kim tra c thc hin u trng thi PASS. M giao din Failover Cluster Manager, bn di mc Management, nhn vo ng dn Validate a Configuration

Trong hp thoi Select Servers or a Cluster, chn Browse v chn hostname ca Cluster va to (V d: SQLCluster) B Cng Thng MOIT Nguyn Vn c NCSTech

Page 30

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Testing Options, chn Run all test (recommended), v nhn Next.

Trong hp thoi Confirmation, nhn Next. Qu trnh kim tra s c thc hin

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 31

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 32

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Summary, ta cn chc chn rng khng c bt c mt li no xy ra. Nhn Finish hon tt.

4. Cu hnh Cluster Quorum


Sau khi to xong mt Cluster v Validate khng c bt k mt li no, ta s tip tc cu hnh Cluster Quorum. M giao din Failover Cluster Manager, chn tn ca Cluster m chng ta va mi to. Nhp chut phi vo Cluster, chn More Actions, v nhn Configure Cluster Quorum Settings Giao din Configure Cluster Quorum s m ra.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 33

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Select Quorum Configuration, chn Node and Disk Majority (recommended for your current number of nodes)

Trong hp thoi Configure Storage Witness, chn a m chng ta mun Cluster s dng lm Quorum/Witness. Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 34

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Confirmation, kim tra li thng tin v nhn Next

Qu trnh cu hnh s din ra. Trong hp thoi Summary, nhn Finish hon tt

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 35

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

5. Ci t MsDTC
c th ci t SQL Cluster, chng ta cn ci t dch v MsDTC cho Cluster. Cc thao tc nh bn di. M giao din Failover Cluster Manager trn bt k Node Cluster no. Bn di tn Cluster, nhp chut phi vo Services and Application, chn Configure a Service or Application, High Availability Wizard s xut hin.

Trong hp thoi Select Service or Application, nhn chn Distributed Transaction Coordinator (DTC), nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 36

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Client Access Point, nhp vo tn v IP ca MsDTC Cluster (V d: SQLClusterdtc, IP: 192.168.70.93 / 24). Nn dng tn v IP khc vi nhng g chng ta t cho Windows Server 2008 Cluster. Nhn Next.

Trong hp thoi Select Storage, chn a s c dng cho MSDTC. Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 37

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Confirmation, kim tra li cu hnh chn v nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 38

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Summary, nhn Finish hon tt qu trnh ci t. V. Ci t SQL 2008 R2 Failover Cluster Sau khi ci t hon chnh Windows Server 2008 Failover Cluster v cc services cn thit nh cp trn, chng ta c th ci t SQL 2008 Failover Cluster theo cc bc sau.

1. Ci t SQL 2008 Failover Cluster trn mt Node


Chy file setup.exe t a ci t m SQL Server Installation Center. Nhp chut vo ng dn Installation bn tri. Nhp chut vo ng dn New SQL Server failover cluster installation m giao din SQL Server 2008 R2 Setup.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 39

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Setup Support Rules, chc chn rng kt qu kim tra c tr v l thnh cng. Nhn Next.

Trong hp thoi Product Key, nhp vo Product key c km theo a ci t (product key c th tch hp v hin th m khng cn nhp nu s dng a ci t c bn quyn t Microsoft). Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 40

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi License Terms, nh du chn vo I accept the license terms v nhn Next.

Trong hp thoi Setup Support Files, nhn Install.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 41

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Qu trnh nh gi s din ra v ta cn phi chc chn rng kt qu tr v l thnh cng. Nu c mt gi tr no b li trong qu trnh nh gi, chng ta s khng th ci t c SQL 2008 B Cng Thng MOIT Nguyn Vn c NCSTech Page 42

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Failover Cluster. Cc li pht sinh trong qu trnh nh gi phi c khc phc hon ton trc khi bt u ci t SQL 2008 Failover Cluster. Nhn Next tip tc.

Trong hp thoi Feature Selection, nh du chn nhng thnh phn mun ci t. Cho th mc Shared feature directory v Shared feature directory (x86), ta c th gi mc nh l C:\

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 43

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Instance Configuration, ln lt nhp vo SQL Server Network Name, Instance Name, Instance ID (V d: SQLDATABASE). Nhn Next.

Trong hp thoi Disk Space Requirements, nhn Next tip tc. Trong hp thoi Cluster Resource Group, kim tra nhng ti nguyn c th c dng cho Cluster. Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 44

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Cluster Disk Selection, chn nhng a m s c dng trn SQL Server 2008. V d: a c cu hnh cluster Database s c chn. Nhn Next.

Trong hp thoi Cluster Network Configuration, b chn DHCP, nhp vo Address (Vd: 1921.68.1.144 / 24). Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 45

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Cluster Security Policy, chn Use service SIDs(recommended) v nhn Next.

Trong hp thoi Server Configuration, nhn vo Use the same account for all SQL Server services. Nhp ln lt cc gi tr Account Name (sqluser), Password (y l user/pass m chng ta to trong giai on chun b) v nhn OK. Nhn Next tip tc. B Cng Thng MOIT Nguyn Vn c NCSTech Page 46

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Database Engine Configuration, ln lt cu hnh cc Tab nh bn di. Tab Account Provisioning, chn cch chng thc m Mixed Mode (SQL Server authentication and windows authentication). Sau nhp ln lt mt khu cho account

SQL Server System Administrator (sa) y l account qun tr SQL Server c th dng ng nhp cho cc H iu hnh khc nhau (V d: Linux, Windows, Solaris) v thm vo cc
user trong trng hp chng ta s dng h iu hnh windows, mun chng thc bng user ca windows.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 47

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Tab Data Directories, kim tra v chc chn rng cc th mc d liu u c lu vo ng a SAN m ta Map v chn trong hp thoi Cluster Disk Selection.

Trong cc hp thoi k tip, chn Next n hp thoi Ready to Install, nhn Install qu trnh ci t c thc hin.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 48

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

Trong hp thoi Complete, nhn Close hon tt qu trnh ci t SQL Server 2008 Failover Cluster cho mt Node Server. B Cng Thng MOIT Nguyn Vn c NCSTech Page 49

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI

2. Thm Node vo SQL 2008 Failover Cluster


Sau khi ci t hon tt SQL Server 2008 Failover Cluster cho mt Node server, chng ta s tin hnh thm node vo Cluster ny. Thc hin ln lt cc bc bn di. Chy file Setup.exe t a ci t m SQL Server Installation Center. Nhp chut vo ng dn Installation bn tri. Nhp chut vo ng dn Add node to a SQL Server failover cluster m giao din SQL Server 2008 R2 Setup

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 50

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Setup Support Rules, chc chn rng kt qu tr v l thnh cng. Nhn Next. Trong hp thoi Product Key, nhp vo Product key c km theo a ci t (product key c th tch hp v hin th m khng cn nhp nu s dng a ci t c bn quyn t Microsoft). Nhn Next. Trong hp thoi License Terms, nh du chn vo I accept the license terms v nhn Next. Trong hp thoi Cluster Node Configuration, kim tra v m bo nhng thng tin hin th l chnh xc bao gm SQL Server instance name (VD: ClusterDATABASE chng ta ci t trn), Name of this node (VD: SQL-CLUSTER-02) Tn hostname ca node service

hin ti m chng ta ang tin hnh thm vo Cluster

Trong hp thoi Service Accounts, nhn vo Use the same account for all SQL Server services. Nhp ln lt cc gi tr Account Name (sqluser), Password (y l user/pass m chng ta chun b phi trng vi user m chng ta cu hnh cho Node u tin) v nhn OK. Nhn Next tip tc. Trong hp thoi Error Reporting, nhn Next Trong hp thoi Add Node Rules, chc chn tt c cc kim tra u thnh cng. Nhn Next.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 51

SQL 2008 FAILOVER CLUSTER TI LIU TRIN KHAI


Trong hp thoi Ready to Add Node, xem li thng tin v nhn Install Trong hp thoi Complete. Nhn Close hon tt.

B Cng Thng MOIT Nguyn Vn c NCSTech

Page 52