In my last article, we discussed how to configure replication and mirroring of SQL Server data via Double-Take. Once you have properly configured your replication sets, you can configure failover and begin monitoring and testing. In this article, we will discuss how to configure and test a Failover in action.
Before configuring failover, you will need to configure a set of batch files called Postover.bat and Preback.bat. These batch files start and stop SQL Server during a failover. You can download the scripts from NSIsoftware's web site or create the batch files as shown below in Figure A.
Postover.bat net start "Distributed Transaction Coordinator" net start "Message Queuing" net start "MSSQLServer" net start "SQLServerAgent" Preback.bat net stop "Distributed Transaction Coordinator" net stop "Message Queuing" net stop "MSSQLServer" net stop "SQLServerAgent"
Configuring your Failover
In order to configure your failover, choose Start | Programs | Double-Take| Failover Control Center and the following screen appears in Figure A.
You can either choose the Target machine from the dropdown or click on Add Target and type the machine name as shown in Figure B.
Note: For the purposes of this article, Beast (192.168.2.100) is the Target server and Belle (192.168.2.101) is the Source server.
Next, click the Login button and choose Add Monitor. On this window, type the name of the Source (BELLE) server and click OK (Figure C.) The name of the server and IP address appears in the left hand column and allows you to place a checkmark in the box as shown in Figure D.
On this window, you can select your failover to be Automatic or Manual. Secondly, you can also decide what items you want to failover. Once you have chosen your options, click Scripts. This is where you will attach your postover and preback batch file scripts. In the event of a failover, the scripts will shut down the specific services and start them on the Target server. When a failback occurs, it will do the opposite. Without attaching these scripts, this functionality will not work. (Figure E.) Click OK twice and your two SQL Servers are now being monitored as shown in Figure F.
When a failover occurs on the Source machine, your target machine will begin to process the requests for both machine names and IP addresses as shown in Figure G.