I need to configure 2 target servers.
A primary server and a secondary server which should be used only when <IsFallback>true</IsFallback>.
I have added a HealthMonitor to check the health of server.
When primary server goes down, it is calling the secondary target server. But when primary server comes back up again, it still going to the secondary server.
Can someone please post how to set up load balancer with monitor?
<HTTPTargetConnection> <LoadBalancer> <Server name="ts_primary"/> <MaxFailures>1</MaxFailures> <Server name="ts_secondary"> <IsFallback>true</IsFallback> </Server> </LoadBalancer> <Path>/v1/user_management</Path> <HealthMonitor> <IsEnabled>true</IsEnabled> <IntervalInSec>5</IntervalInSec> <TCPMonitor> <ConnectTimeoutInSec>10</ConnectTimeoutInSec> <Port>80</Port> </TCPMonitor> </HealthMonitor> </HTTPTargetConnection>
Solved! Go to Solution.
Ideally, the failed target servers should be added back into rotation if a health monitor is used and if the given health monitor TCP socket becomes healthy:
https://docs.apigee.com/api-platform/deploy/load-balancing-across-backend-servers#healthmonitoring
Would it be possible for you to verify the port given in the TCP monitor and the actual port of each target server to check whether the given health check is valid?