Having trouble with Load Balancing across TargetServers

Not applicable

I am trying to create a load balancer in my target endpoint. I keep getting the error message: Duplicate target server references found in target endpoint TargetEndpoint-Customer. Not sure why this is happening.

This is what I have configured:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<TargetEndpoint name="TargetEndpoint-Customer"> 
  <Description/> 
  <FaultRules/> 
  <PreFlow name="PreFlow"> 
    <Request/> 
    <Response/> 
  </PreFlow> 
  <PostFlow name="PostFlow"> 
    <Request/> 
    <Response/> 
  </PostFlow> 
  <Flows/> 
  <HTTPTargetConnection> 
    <LoadBalancer> 
      <Algorithm>RoundRobin</Algorithm> 
      <Server> name="ejav-eps-target-customer-1"</Server> 
      <Server> name="ejav-eps-target-customer-2"</Server> 
    </LoadBalancer> 
    <Path>/this/test</Path> 
  </HTTPTargetConnection> 
</TargetEndpoint>

What am I doing wrong?

1 3 331
3 REPLIES 3

Hard to know if this is what is causing the problem, but if your pasted config is accurate, I'd say you need to specify the name for the Server entries differently. You have:

   <LoadBalancer> 
      <Algorithm>RoundRobin</Algorithm> 
      <Server> name="ejav-eps-target-customer-1"</Server> 
      <Server> name="ejav-eps-target-customer-2"</Server> 
    </LoadBalancer> 

And what is required is the name= attribute needs to be on the server element itself. Like this:

   <LoadBalancer> 
      <Algorithm>RoundRobin</Algorithm> 
      <Server name="ejav-eps-target-customer-1"/> 
      <Server name="ejav-eps-target-customer-2"/> 
    </LoadBalancer> 

Maybe a subtle difference, but ... according to the documentation for this feature, that's what the configuration needs to be.

Try and see?

@Rick Decker ,

Here is the 4MV4D that explains the target servers load balancing.

6723-screen-shot-2018-04-07-at-55032-pm.png

------------------------------------------------------------------------------------------------------------

Anil Sagar

5997-screen-shot-2017-11-23-at-75916-pm.png Learn Apigee Concepts in 4 Minutes HandsOn

I made the change as shown below however I am now getting the below error.

Error Saving Revision 1 Error occurred while validation of bean default.xml. Reason: - Schema validation failed. Cause : unexpected element (uri:"", local:"Server"). Expected elements are <{}Path>,<{}SSLInfo>,<{}HealthMonitor>,<{}LoadBalancer>,<{}SessionCache>,<{}Properties>,<{}URL>,<{}ErrorResponse>. Line number : 16. Column number : 17. File name : default.xml.



<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <TargetEndpoint name="TargetEndpoint-Customer"> <Description/> <FaultRules/> <PreFlow name="PreFlow"> <Request/> <Response/> </PreFlow> <PostFlow name="PostFlow"> <Request/> <Response/> </PostFlow> <Flows/> <HTTPTargetConnection> <Properties/> <LoadBalancer> <Server name="ejav-eps-target-customer-1"/> <Server name="ejav-eps-target-customer-2"/> </LoadBalancer> <Path>/Eps/EPSHttpService</Path> </HTTPTargetConnection> </TargetEndpoint>