Example: Setting up CDP Failover

Suppose you have a CDP Job called "Bills" with its master on computer "SRC-LA" and with a Vault and Agent on computer "BCKUP-SD" with an IP address of 192.168.0.1.

The following are complete setup instructions

  1. Deploy the Vault on "BCKUP-SD."

  2. Deploy a master Agent on SRC-LA and create a file backup Job Bills linked to BCKUP-SD. Your data is now continuously backed up to BCKUP-SD. SRC-LA is running an Agent in master mode.

  3. Deploy a backup Agent on BCKUP-SD and link to the Job in the WAFS Agent Manager using Service > Create new job > Link to an existing backup Job. Make sure the Vault is specified using its IP address (in this example, 192.168.0.1), not the computer name. You now have a slave mode Agent cohosted with the Vault on BCKUP-SD and connected to the Job Bills.

  4. On the Vault computer, BCKUP-SD, create a file C:\WAFS_disconnected.bat with the following contents:

    REM We are passed three variables:

    REM %1 is this Job's name

    REM %2 is the location of this Job's data in the Vault

    REM %3 is the path for the Agent's executable, which we need in order to set its mode

    REM set this computer's cohosted Agent to master mode

    REM change this IP to the Vault's IP.

    %3 -setmode um "\\192.168.0.1\%1"

    REM log this event

    set logFile="C:\AD\_Logs\disconnect-log.txt"

    echo Master server disconnected at %DATE% %TIME% >> %logFile%

    echo Job: %1 >> %logFile%

    echo Vault: %2 >> %logFile%

    echo AvlAgt: %3 >> %logFile%

    echo. >> %logFile%

    REM as an easy way of popping up an alert, launch notepad with a defined message

    set messageFile="C:\AD\_Logs\message.txt"

    echo The master has just disconnected! > %messageFile%

    echo Setting cohosted Agent on this computer from Slave to Master. >> %messageFile%

    echo at %TIME% on %DATE%. >> %messageFile%

    notepad %messageFile%

    This sample switches the slave Agent that is cohosted on the Vault to master mode, makes a log of the switch and creates and opens a text file with a message to alert the administrator at the backup computer. Your script could contain e-mail notifications, DFS commands, or other actions to automate redirecting other computers to the new master.

  5. On the master computer SRC-LA, create a file C:\Program Files (x86)\Globalscape\WAFS Agent\srv_Disconnect.bat with the following contents:

    REM We are passed two variables:

    REM %1 is the name of the server we're disconnected from

    REM %2 is the reason why we were disconnected

    REM set this Agent to slave mode

    REM change this Job name to your Job's name

    C:\\Program Files\\GlobalSCAPE\\WAFS Agent\\WafsAgentManager.exe -setmode us "\\192.168.0.1\Bills"

    REM log this event

    set logFile="C:\Program Files (x86)\Globalscape\WAFS Agent\disconnect-log.txt"

    echo Disconnected from server at %DATE% %TIME% >> %logFile%

    echo server: %1 >> %logFile%

    echo reason: %2 >> %logFile%

    echo. >> %logFile%

    REM as an easy way of popping up an alert, launch notepad with a defined message

    set messageFile="C:\Program Files (x86)\Globalscape\WAFS Agent\message.txt"

    echo We have just disconnected! > %messageFile%

    echo Setting Agent on this computer from Master to Slave. >> %messageFile%

    echo at %TIME% on %DATE%. >> %messageFile%

    notepad %messageFile%

  6. Login in to the web interface as an administrator, then click Failover List.

  7. In the Job Name list, click the Job's name. The Set Failover Script dialog box appears.

  8. Select the Run script when job is disconnected check box.

  9. In the text field next to Script to run box, type:

    C:\WAFS_disconnected.bat

  10. Specify the appropriate number of Seconds to wait after disconnecting that the master must be disconnected before the script is run; 120 is a good default. (You may want to set this to something very short initially, such as 5 seconds, so that testing the setup is quicker. Once you test the setup and see that it works, you can change this back to a more reasonable time.)

Your failover setup is now complete. Check both the master and slave Agents to make sure they are configured correctly. They should both be set to CDP - continuous backup (Unidirectional), and the cohosted Agent should be in slave mode, while the other is in master. You can test this by making a change to the linked folder on the master system and making sure that it is replicated at the cohosted Vault/Agent system.

To test the failover

To test the failover, you must simulate an unexpected disconnect; just shutting down the master Agent service will not trigger failover. Two easy options for doing this are to disconnect the master Agent's network connection or to change the Vault computer's firewall to block the Agent (e.g. blocking all activity on the Job's port, which is 80 by default).

Now reconnect the Agent and follow the instructions above to reestablish the original master and slave setup.