Vous êtes sur la page 1sur 89

Setup Microsoft SQL Server 2008 R2 Failover Cluster in VMware Workstation

If you search on internet about setting up Microsoft SQL Server 2008 R2 Failover Cluster in any desktop virtualization software, you cant find it in one place. Here you can see step by step how to setup Microsoft SQL Server 2008 R2 Failover Cluster in VMware Workstation on your personal computer. Hardware Information: Dell Inspiron 570 AMD Athlon II x3 435 Processor 2.9 GHz Installed memory (RAM): Hard disk: System type: Operating System: Required Software: 1) VMWare Workstation 7 (with free trial for 30 days) VMware-workstation-full-7.1.3-324285 2) Windows Server 2008 R2 (with trial license free for 180 days) 7600.16385.090713-1255_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD 3) Starwind Software (with free trial for 30 days) 4) SQL Server 2008 R2 (Download from Microsoft website) 5) Three virtual machines: one setup as Domain Controller and DNS Server(DC), the other two as clustered nodes (WIN1 and WIN2). 6.00 GB 500GB 64-bit Operating System Windows 7 Home Premium

I. Installation of VMware and Create Virtual Machines


1) install VMware ( I am sure you all know how to install VMware software on your computer) 2) create first VM machine named DC (Domain Controller) Choose Typical (recommended) and Click Next

Click I will install the operating system later and click Next

Choose Microsoft Windows for Guest Operating system and choose Windows Server 2008 R2x64 for version and click Next

Give Virtual machine name: DC and type in the path of the location of VM going to be created.

Default maximum disk size is 40GB, you may adjust allocation size according to your own needs.

Review the summary page and click Finish. You may also customize your Hardware settings by clicking Customize Hardware

3) click Edit Virtual Machine Settings tab to point Virtual CD Rom to use ISO image file:

4) Power on VM and start installation of Windows Server 2008 R2 The next few steps are pretty much self explanatory.

Choose Windows Server 2008 R2 Enterprise Edition

Give a strong password when prompted and I am done with installing Windows Server 2008R2.

5) Clone two more VM machines as WIN1 and WIN2 from DC.

Choose Create a full clone and Click Next

Enter WIN1 for Virtual machine name and path for location

6) do the same as above steps to clone WIN2. 7) Configure network card information a) assign static I.P to three machines as DC I.P Address Subnet Mask Default Gateway DNS Server 192.168.102.128 255.255.255.0 192.168.102.2 192.168.102.128 WIN1 192.168.102.129 255.255.255.0 192.168.102.2 192.168.102.128 WIN2 192.168.102.130 255.255.255.0 192.168.102.2 192.168.102.128

b) make sure three machines can ping each other. 3, Install Active Directory Service on DC and thus creating DNS Server as well. 1) Install Active Directory Service

2) start dcpromo.exe command and the next screen will show up:

Choose Assign Static I.P. option

4, Add Win1 and Win2 to Domain Controller a) Add WIN2 to Domain Controller Click Change

Enter Domain name as testcluster.com

b) Add WIN1 to the domain.

III. Install Starwind Software to create SCSI disks:


1) Install Starwind software on DC virtual machine

2) Start Starwind software In the left pane, right click testcluster.com and click Connect At the login prompt, the username field will have root already entered. Enter starwind for the password and click OK. In the left pane, right click Targets and select Add Target. Add a target alias as of Quorum and click Next.

Leave Storage type as Hard Disk and click Next

Leave Device Type as Basic Virtual and click Next

Leave Device type as Image File Device and click Next

Click Create New Virtual Disk and click Next

Type in name of c:\q.img, enter 5210 for the size in MB field and click Next

Leave Asnychronous mode selected, select Allow Multiple concurrent iSCSI connections (clustering) and click Next

Bypassing this screen and click Next

Click Next to continue

Click Finish to complete creating an iSCSI disk

Do the same for the following disks: Name Data Logs MSDTC File c:\s.img c:\l.img c:\m.img Size 5120Mb 5120Mb 5210Mb

Close StarWindManagement Console Configuring the iSCSI initiator Click WIN1 tab

If Microsoft iSCSI service is not already started, you will see next popup and just click Yes to continue.

Enter Target name or I.P in the Target window: Click Connect for each disk.

Do the same for the WIN2.

Open the computer management window:

Right click disk management will bring up the next window:

Bring the disks online and initialize the disks and label them

Do the same for DISK2, DISK3 and DISK4, assigning them drive letters Q,L and M and labeling them, Logs, Quorum and MSDTC, respectively.

IV. Adding Failover Cluster Feature on each node and Verifying Cluster
1) Adding Failover cluster feature on each node(WIN1 and WIN2)

2) Validating a Windows failover Cluster

Enter the server name of the clustered node: Win1.testcluster.com Win2.testcluster.com

There are warnings on the network section, basically saying that there is one point of failure because I only configure one set of network card. In real world, you should configure two sets of network cards for high availability. In our situation here, just a testing, I would just leave as it is. Overall result is pass and at this point, we can go ahead install SQL Server 2008 R2

V. Installation of SQL Server 2008 R2


1) Runing Failover Cluster Wizard

Enter win1.testcluster.com, win2.testcluster.com

Enter vmcluster for Cluster Name and 192.168.102.131 for I.P Address.

3) Installing MSDTC on a failover cluster

Enter vmclusterDTC for Name and 192.168.102.132 for I.P Address.

Check mark Cluster Disk4 and click Next

vmclusterDtc service is created and online

4) Installing SQL Server 2008 R2 on WIN1

Choose New SQL Server Failover cluster installation

Choose Disk2 and Disk3

Uncheck DHCP and type in I.P address 192.168.102.133

Choose use the same account for all SQL Server services

VI. Add WIN2 to the SQL Cluster


Choose Add node to a SQL Server failover cluster

Enter password for SQL Server Engine and SQL Server Agent account.

VII. Test Failover


Start Microsoft SQL Server Management Studio from DC machine and connect to SQL Server on the SQL Cluster do a query (see below)

Current owner is WIN2

I will initiate Failover to WIN1 from WIN2

Click Move SQL Server (MSSQLSERVER) to WIN1 and wait for about 20 seconds.

Now current owner is WIN1

In the management Studio, click the Execute button again, the same query will run and return the following result:

Congratulations. You have successfully setup SQL Server 2008 R2 Failover Cluster on your personal computer. The whole process has been tested twice on my desktop computer. Any questions or comments are welcome. Hope it helps if you are setting up your own failover cluster.

Vous aimerez peut-être aussi