Using Custom Script execution feature to change the virtual IP address of the system during HA failover

In an HA environment, if the Stub microservices such as WSStub and RESTStub are being used, the clients have to use the IP address of the active/standalone server to connect to the Stub microservices.

If there is a failover ie., if primary HA server goes down and the secondary server becomes the standalone/active server, the user needs to change the IP address on their client machines or needs to use a load balancer to switch automatically.

To avoid using a load balancer as explained above, the custom script execution feature can be used to add/remove Virtual IP address while the server switches to states such as Active, Standalone and Passive. The script should add a virtual IP address if the server switches to standalone or active state and should remove the Virtual IP if the server switches the state to passive or waiting or during server shutdown. A sample script for the same is provided at FioranoHome/esb/samples/scripts.

To configure the Server profile for the same, perform the following actions:

  1. Open eStudio and go to the profile manager.
  2. Open the Peer Primary HA profile.
  3. Go to Fiorano > Esb > Ha > Server > HAFPSServer and configure the properties below:
    1. Enable the ScriptEnable property and provide the ScriptExecutionWaitTime property value.
    2. Provide the IP Addition script execution command for 'ActiveStartScript' and 'StandaloneScript'.
    3. Provide the IP Removal script execution command for 'PassiveStartScript' and 'ShutdownScript' too.



  4. Press CTRL+S or click the Save  icon to save the profile.
  5. Perform above actions for the Peer Secondary HA profile too.
  6. Start the servers.

    Icon

    The server which switches to the Active/Standalone state allows adding the Virtual IP address.

    The server which switches to the Passive state allows removing the Virtual IP (If the IP is already added).

Adaptavist ThemeBuilder EngineAtlassian Confluence