Distributed Replay is a new fonctionality of Microsoft SQL Server 2012. It helps you assess the impact of future upgrades (SQL Server, hardware, OS) or SQL Server tunings by replaying a trace captured from a productive SQL Server environment to a new SQL Server test environment.

This new functionality is similar to SQL Server Profiler, but with more possibilities: e. g. replaying the trace from multiple clients (up to sixteen), use a stress or  synchronization mode, configure options like think time, or connect time etc.

Distributed Replay installation and configurations

To use Distributed Replay, we have to install a Distributed Replay Controller and 1 to 16 Distributed Replay Clients. In this exemple, I will use a Distributed Replay controller and a Distributed Client on server VMTESTSQLWIN01, a second Distributed Replay Client on server VMTESTSQLWIN02 and a target instance with SQL Server 2008 R2 on WMTESTSQLWIN03.

Do not fortget to also install Management Tools which provides Distributed Replay administration tools!

b2ap3_thumbnail_DR_Config_Test.jpg

First, we have to create two Active Directory accounts.

1) One for the Distributed Replay Controller: MSTESTDR_controller:

b2ap3_thumbnail_AD_DR_Controller.jpg

2) And another for the Distributed Replay Client: MSTESTDR_client:

b2ap3_thumbnail_AD_DR_Client.jpg

Distributed Replay installation

We now have to install Distributed Replay Controller, Distributed Replay Client, and Management Tools on our VMTESTSQLWIN01 server which will be the Controller of our Distributed Replay and also the Client:

b2ap3_thumbnail_Install.jpg

On the Server Configuration, add the two Actice Directory accounts created for Distributed Replay Controller and Distributed Replay Client:

b2ap3_thumbnail_Install_DR_ClientController_Users.jpg

On the Distributed Replay Controller Page, add the Active Directory account previously created for the Controller. On the Distributed Replay Client page, add the Controller name:

b2ap3_thumbnail_Install_DR_ClientController_ControllerName.jpg

Continue the installation until the Complete Screen appears:

b2ap3_thumbnail_Install_DR_ClientController_Succed.jpg

Now, our VMTESTSQLWIN01 has Distributed Replay installed.

We have to install the second Distributed Replay Client on VMTESTSQLWIN02:

b2ap3_thumbnail_Install_DR_Client.jpg

On the Server Configuration, add the Actice Directory account created for Distributed Replay Client:

b2ap3_thumbnail_Install_DR_Client_ServiceAccount.jpg

Configure the Distributed Replay Controller for the client:

b2ap3_thumbnail_Install_DR_Client_ControllerName.jpg

Finish the installation:

b2ap3_thumbnail_Install_DR_Client_Succed.jpg

Windows Firewall configurations

To allow Distributed Replay Clients to connect and register to the Distributed Replay controller, inbound connection for DReplayClient.exe application has to be allowed on each Distributed Replay Client through the Windows firewall.

Go to Windows firewall, Inbound Rules, and add a new rule for a program:

b2ap3_thumbnail_DR_AddFirewall_InboundRules.jpg

Browse to the DReplayClient.exe location:

b2ap3_thumbnail_DR_AddFirewall_InboundRules2.jpg

Allow the connection:

b2ap3_thumbnail_DR_AddFirewall_InboundRules3.jpg

Give a name to this new rule and click Finish:

b2ap3_thumbnail_DR_AddFirewall_InboundRules4.jpg

Now, configure the Windows firewall on the Distributed Replay Controller to allow inbound connection for DReplayController.exe application using the same way.

In the target Server VMTESTSQLWIN03, we also have to configure the Windows firewall for inbound on port TCP 1433 to let the Distributed Replay Client write on the target. Select the port:

b2ap3_thumbnail_Target_OpenPort_TCP1433_1.jpg

Protocol TCP and port number 1433:

b2ap3_thumbnail_Target_OpenPort_TCP1433_2.jpg

Allow the connection:

b2ap3_thumbnail_Target_OpenPort_TCP1433_3.jpg

Apply this rule for Domain, Private, and Public:

b2ap3_thumbnail_Target_OpenPort_TCP1433_4.jpg

Specify a name for this new inbound and click Finish to save it:

b2ap3_thumbnail_Target_OpenPort_TCP1433_5.jpg

Now the firewall is configured on each server!

Start Services and check client registrations

You first have to start the Controller service on the Distributed Replay Controller.
Go to VMTESTSQLWIN01, open a command prompt screen and enter:

NET STOP "SQL Server Distributed Replay Controller"
NET START "SQL Server Distributed Replay Controller"

You should see the result of this command in the log folder of Distributed Replay Controller under C:Program Files (x86)Microsoft SQL Server110ToolsDReplayControllerlog.

You have now to start Distributed Replay Client service on your Distributed Replay Clients VMTESTSQLWIN01 and VMTESTSQLWIN02. Verify that they are correctly synchronised with your Distributed Replay Controller.

On both servers, open a command prompt screen and run:

NET STOP "SQL Server Distributed Replay Client"
NET START "SQL Server Distributed Replay Client"

To see if the Client is successfully registred with the controller, open the last log file in the location C:Program Files (x86)Microsoft SQL Server110ToolsDReplayClientlog and check the last line of the file. This could be something like that:

b2ap3_thumbnail_DR_Client_ConnectedToController.jpg

If this was successul for the two clients, the configuration between the controller and clients is finished and the Distributed Replay is ready to work.

If you have a log file like this…

b2ap3_thumbnail_DR_FailToConnectFromWin02ToWin01_20130325-104746_1.jpg

…it means the registration failed, so:

  • check if the controller name is right in the DReplayClient.config file
  • check if, for each client, there is an inbound rule to allow connections for the DReplayClient.exe application
  • check if, for the controller, there is an inbound rule to allow connections for the DReplayController.exe application

Conclusion

At this point, our Distributed Replay application is ready to use, clients and controller are registred together.

You now have to create a trace, preprocess it and replay it from our clients to the target SQL Server.

This will be the content of my next blog posting.