Tuesday, July 21, 2009

SQL Failover for XenApp DataStore

Hi!

I needed to create a Microsoft Cluster with SQL failover for a problem I am troubleshooting. I have nothing setup other than my XenServers.

First Step, build 2 Windows 2003 SP2 Enterprise Edition Servers

Next I needed some shared storage.
I have a VM with OpenFiler installed. This can be used to share storage over the network in different methods including iSCSI, NFS, SMB etc etc.

A good guide for this can be found here

http://www.petri.co.il/use-openfiler-as-free-vmware-esx-san-server.htm

This guide is for creating a volume for use with vmware esx but it is still relevant for creating a share for my situation.

Next step was to make sure I could access the iSCSI Target from my servers. To do this I needed to install the iSCSI initiator which can be found here.

http://www.microsoft.com/downloads/details.aspx?familyid=12cb3c1a-15d6-4585-b385-befd1319f825&displaylang=en

Once installed run the shortcut on your desktop and you have the option to connect to your iSCSI target. Stick in the IP address and then connect. (There is an option to choose connect at reboot)

At this point I will refer you to an amazing guide which is for building a Cluster Server

http://www.microsoft.com/downloads/details.aspx?familyid=96F76ED7-9634-4300-9159-89638F4B4EF7&displaylang=en

It is pretty comprehensive but well worth taking some time to read and follow.

Once complete you should have 2 servers in your domain which are part of a cluster. The next part is to install SQL....you guessed it another guide!!

http://www.sql-server-performance.com/articles/clustering/cluster_sql_server_2005_p1.aspx

This is a brilliant step by step guide! Very simple to follow but comprehensive enough not to miss anything!

After following the last guide you should have 2 servers in your domain which are part of a cluster. There should be 1 cluster group which contains your Quorum and 1 cluster group for your SQL install. At this point I created a new XenApp farm and pointed it towards the namespace for the cluster (in my case it was creatively called SQL). This should work like a regular SQL database but with the added advantage that you can do maintenance during the day or for failure. This can be tested by doing the following.

One one of the server nodes Start > Run > Cluadmin. This will bring up the admin screen. In here you can click on the cluster and sql groups and it will tell you which node is active for them. You can right click these groups and tell it to "move group"

You should see no downtime on your SQL database, potentially there may be some performance impact which should be tested though.

If you want to test this thoroughly I would advise doing the following.

Visit this link from the active node
http://support.microsoft.com/kb/Q244139

This tells you how to manually create a crash dump (blue screen of death) ,initiate this and you will see the BSOD. Login to the other node and open cluadmin and you will see the other node with a red x next to it. You will then see the groups move over to the only node which is left.

In my environment I saw a momentary blip in communication between my XenApp server and database but nothing which actually caused a problem.

I would of written a more in depth guide but there is no point in reinventing the wheel. This is just an extended tasklist!

Sam!

0 comments:

Post a Comment