You are on page 1of 2

Citrix XenApp Server Farm Disaster Recovery using MS Sql 2008 R2 DB Mirroring

Requirements:
Three Microsoft Enterprise Edition SQL 2008 Servers with SQL Service Pack 1 (Roles: 1. Principal 2. Mirror 3. Witness) 1 MS Sql server is available already and we need to setup 2 more.

SQL Server Configurations:


Database is already created on Principal Server with the name citrixds Need to verify the data store database by selecting Full in the Recovery model dropdown list in the Options page of the Database Properties. This is the default behavior: Verify the SQL Server is using an Active Directory account. Ideally, use the same account for all three SQL Servers(Primary, Mirroring, Witness) Back up the database on the principal SQL Server. Create a database to the mirroring server. Mirroring Server, From the Options page under Restore Database, back up the database to the mirroring server by selecting the Overwrite the existing database. Under Recovery state, select the RESTORE WITH NORECOVERY as shown below The following is a sample script, but you can use the wizard in SQL Server Management Studio (right click database tasks > backup):
[RESTORE DATABASE [citrixds] FROM DISK = N'C:\citrixds.bak' WITH FILE = 1, NORECOVERY, NOUNLOAD, REPLACE, STATS = 10]

Go to the Primary SQL Server DB and Start the mirroring process. Right-click the Database > Properties > Mirroring and click Configure Security to start the wizard. On the Configure Database Mirroring Security Wizard screen, click next. On the Include Witness Server screen, select Yes and click Next: Select the principal server. Select the mirroring server (click Connect ). Select the witness (click Connect). Enter the SQL Server service accounts. Note: If all SQL Servers are using the Same existing account, leave everything blank. Start the mirroring process by clicking Start Mirroring

Note: The database on the mirroring server is not available until a failover has occurred. All database transactions are first committed on the mirror database before the principal database. This might slow transactions, depending on the network performance.

XenApp Server Configuration:


1. Need to adjust the data store timeout value to accommodate the failure over the transition period. 2. Stop the IMA Service (use the net stop imaservice command). 3. Install the SQL Native Client from

4. Edit the Data Source Name (DSN) in four spots as follows:


[ODBC] DRIVER={SQL Native Client} UID=administrator Trusted_Connection=Yes DATABASE=XA DS WSID=DHARMAEXA02 APP=Citrix IMA SERVER=DHARMAESQ02 Failover_Partner=DHARMAESQ01 Description=ds

5. Start the IMA Service (use the net start imaservice command) . Note: The SQL Client and the DSN modification must be installed on every XenApp server. Only the Driver and Failover_Partner fields need to be changed.

Verification:
Note: During the failover transition there is a short duration of time where the IMA data store is not available. This is as expected. Initiate a failover on the principal SQL Server either by using the Failover button (go to Database > Properties > Mirroring > Failover) or stopping SQL itself. Test by issuing the qfarm command at the command prompt at least twice or by using the CitrixManagement Console. Both require the data store to be available. Revert back to the original database by clicking Failover.

You might also like