In a previous post I discussed how Citrix uses XenApp internally. One facet of our design is the use of a single global Farm. In our global Farm design we use a replicated Data Store. Today I am going to go over how to quickly stand up a replicated Data Store.

Deploy SQL

The first thing you will need is a SQL server in both Zones of the Farm. In this example we’ll be using SQL 2008. Please note, when building the SQL servers do not use any imaging processes to deploy the operating system. Not even Sysprep will work. Imaging causes issues with replication after everything is setup. Also, install in mixed mode and set the SA passwords to be the same for easier configuration.

After SQL is deployed, you need to configure MSDTC security in Component Services, Computers, My Computer, Distributed Transaction Coordinator, and Local DTC. In the properties of the Local DTC, on the security tab, configure the settings as shown below and the reboot the server.



MSDTC

Configure Distributor

On the SQL server that will host the master copy of the Data Store you need to configure the Distributor. After the server reboots go into SQL Server Management Studio expand the server node, right-click the Replication folder, and then click Configure Distribution. The will start the Configure Distribution Wizard. Select the below while following the wizard:

  1. Next to continue
  2. Choose server name will act as its own Distributor and then next
  3. Next to accept default snapshot folder location
  4. Next to accept default Distribution Database
  5. Check server name and next on Publishers page
  6. Check Configure distribution on the Wizard Actions page and then next
  7. Then click finish to perform the configuration

Create Data Store

Now you can create the database you’ll use for your Data Store. Nothing special needs to be done when creating the Data Store. Create the DB and assign permissions to it. Then build the first XenApp server in the Farm to populate the tables in the Data Store.

Configure Publisher

In the SQL Server Management Studio expand the server node, right-click the Replication folder, and then click New Publication to launch the New Publication Wizard. Select the below while following the wizard:

  1. Next to continue
  2. Select the Data Store DB from the list and click next
  3. Select Transactional publication with updatable subscriptions then next
  4. Click on the Tables entry and make sure all the check boxes are selected under Tables as well. Do not select Stored Procedures. Click next to continue
  5. Select next to accept defaults on the Article Issues page
  6. Select next to accept defaults on the Filter Table Rows
  7. Select Create a snapshot immediately … and next
  8. On the Agent Security select the Security Settings button for both Snapshot and Queue Reader and select the Run under SQL Server Agent service. Then select Using the following SQL server login and enter the SA credentials. Select the Use the security settings from the Snapshot Agent under the Log Reader Agent section. We’re using SA since this is for testing. For the more secure method using Windows Authentication review the document found here: http://support.citrix.com/article/CTX118229
  9. Enter and name for the Publication and then click finish.

Setup Subscriber

On each server that will subscribe to the Data Store create a DB. The Data Store information will be replicated into this DB.

On the Publisher open the SQL Server Management Studio expand the server node, expand the Replication folder, expand the Local Publications folder, right-click the Publication you just created and then click New Subscriptions to launch the New Subscriptions Wizard. Select the below while following the wizard:

  1. In the New Subscriptions Wizard select the Publication you previously create and click Next.
  2. Select Run all agents at the Distributor. (push subscription)
  3. Click the Add SQL Server Subscriber button on the next window. This will bring Connect to Server window. Enter the Server name and logon information for the Subscriber server and click connect. The Subscriber will appear in the Subscribers window. Click the check box and choose the DB you created from the pull down menu. Do this for each Subscriber if you have more than one. Click next to continue.
  4. In the Distribution Agent Security window you will see each Subscribing SQL server. Click the button to the far right of each server. This will bring up the Distribution Agent Security details window for that server. Choose the following:
    1. Run under SQL Server Agent service.
    2. By impersonating the process account
    3. Using the following SQL server login: (Enter SA info here)
    4. Click next to continue to the Synchronization Schedule window. Select Run continuously and click next.
    5. In the Updatable Subscriptions window select simultaneously commit change and click next.
    6. In the Login For Updatable Subscriptions windows select Create a linked server that connects using SQL Server Authentication. Enter the SA credentials and click next.
    7. In the Initialize Subscriptions windows choose Immediately under the Initialize When column. Click next.
    8. In the Wizard Actions window select Create the Subscription(s) and then click finish.

The Subscriptions should now be created. It may take a little bit for the information to replicate and you can check the tables on the Subscribers to see that they are created.

Now you can build XenApp servers in the locations you created Subscribers. When you enter the information for Data Store during the install provide the server name and DB name of the local server instead of the remote data base.

I hope these instructions help you setup a replicated Data Store so you can test using a single global Farm for your XenApp deployments.