This Knowledgebase article provides information about implementing automatic restarts of the Active server when running Neverfail Engine software. this is achieved through a scheduled task that runs a batch script.
Rebooting the Active server without stopping gracefully the Neverfail Engine service first can result in unpleasant events like a random failover to the Passive server or the Active server coming back from the reboot as Passive due to seeing its previous stop as unclean. To avoid all this when implementing automatic reboots please follow the procedure below.
1. Create a batch script called "import.bat" containing the following commands:
net stop NFServerR2
timeout /t 300
reg add HKLM\Software\Javasoft\Prefs\neverfail\current\/Controller\ /t REG_SZ /v /Was/Started /d false /f
shutdown -r -t 5
- This script will send a stop command to the Neverfail Engine service, will wait for 5 minutes in order for Engine to clear its Active queue e.g. send the non-replicated data to the Passive server. The next command sets a registry flag so that on next restart Engine sees the previous stop as "graceful" which will make it re-assume Active. The last line in the script sends the restart command for the Windows server.
2. Create a Windows scheduled task with the following settings:
- In the Trigger section you will need to select when the task should run: daily, weekly or monthly.
- In the Action section set it to run the batch script created previously
- Once the credentials are saved for this task, the net stop command will be able to send the stop command to the Engine (NFServerR2) service.