Define an auto-recovery failover mechanism that will take effect when WAFS detects that the connection with the Job is unexpectedly broken (such as due to a communication problem, malfunction at the master Agent's computer, or other reasons; it will not be executed when the Agent is shut down normally).
If you enable the alarm and auto-recovery option for a given Job, the following occurs when communication with the master Agent is broken
The Vault waits the time specified in the seconds box. If communication is resumed with the Master during that time, the auto-failover process is aborted.
If the Copy data into check box is selected, the Vault copies all of the data for this Job's data into the folder specified, typically on another computer. Note that the specified folder must already exist, and should be empty.
Next, the Vault starts the script specified in the Then run this script box. You must provide this script or leave this field blank. This script is passed three parameters:
pathname of the folder in the Vault that contains the Job's data
path to the program that can be used for "setmode," as explained below.
Typically, this script would alarm IT, redirect users and processes, and turn the slave Agent into the master. The script can be any type of executable, such as an .exe file, .bat file or Perl script.
The data on any slave Agent is available in read-only mode. To get full read-write access, a slave needs to change mode and become a master. The script you supply can do this automatically by using the "setmode" argument with the Agent executable, the path to which is supplied as the third argument to the "run this script field" script. The format of this call is:
WafsAgentManager.exe -setmode MODE "\\server\Job"
MODE is the mode the Agent changes to, and can be one of the following:
w - WAFS
um - unidirectional (CDP) master
us - unidirectional slave
The Vault name is specified without the port. For example, if the server is 192.168.0.1 and the Job's name is Bills, this entry should be "\\192.168.0.1\Bills" (include the double-quotes).
Unless you change its setting, when the original Vault comes back online it will still be in master mode. If this happens, it and the new temporary master will "ping-pong," each rewriting its versions of its local folder's contents to the Vault. To avoid this, you should set the original master to slave mode before it comes back online. When the connection is reestablished, the original master, now in slave mode, will then start replicating whatever changes were made to files on the temporary master. When the replication completes, you can manually change the temporary master back into a slave and then the original master back to master mode.
You can have the original Agent master change its mode automatically by creating a script srv_Disconnect.bat in the same folder as the Agent executable, which is by default C:\Program Files (x86)\Globalscape\WAFS Agent. This script will be run whenever the Agent disconnects from any of its Vaults for any reason (including exiting normally, as when you shut down the Agent service).
srv_Disconnect.bat is passed two arguments:
the name of the server that the Agent has disconnected from
the reason for the disconnection, which may be:
exit - Agent exited normally
scheduledDisconnect - Agent is on a schedule and disconnected accordingly
disconnect - generic error; Agent did not expect to be disconnected