Loadbalancer and HealthMonitor is not working as expected

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 Solved
0 2 454
1 ACCEPTED 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:

9080-screen-shot-2019-08-27-at-21322-pm.png

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?

View solution in original post

2 REPLIES 2

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:

9080-screen-shot-2019-08-27-at-21322-pm.png

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?

Thanks Imesh Gunaratne. I was using a different port before. It started working when i made the port same as target server port (port entry need not be there in the monitor config. default is taken as target server port)and used HTTP Monitor checking the health of the service.