How to set multiple fallback servers?

Not applicable

In my apigee onprem I have multiple IPs and for the backend of each proxy. Out of which some are in dc1 and some are in dc2. I need to specify all the IPs of dc1 as active and all the IPs of dc2 as fallback. How can I achieve this ?

Solved Solved
0 7 348
2 ACCEPTED SOLUTIONS

You can do that if the servers in DC2 are behind a common virtual-IP, sometimes called a "VIP".

This VIP might be implemented with a hardware router like an F5 or Netscaler. Or it could be a software router like nginx or haproxy or etc.

In this case you would simply use the DNS name for the VIP as your fallback.

It seems likely that if you place the upstreams in DC2 behind a VIP, you would also want all the upstream systems in DC1 to be behind a different VIP.

View solution in original post

Not applicable

I resolved this using javascript dynamic target urls setting and taking one from the target pool.

View solution in original post

7 REPLIES 7

You can do that if the servers in DC2 are behind a common virtual-IP, sometimes called a "VIP".

This VIP might be implemented with a hardware router like an F5 or Netscaler. Or it could be a software router like nginx or haproxy or etc.

In this case you would simply use the DNS name for the VIP as your fallback.

It seems likely that if you place the upstreams in DC2 behind a VIP, you would also want all the upstream systems in DC1 to be behind a different VIP.

Thanks @Dino. We had the same understanding as well.

Not applicable

I resolved this using javascript dynamic target urls setting and taking one from the target pool.

That also works!

How do you fill the target pool?

I am using two pools pool1 and pool2 with one pool number 1 or 2. All these values are configured in KVM for each proxy. Each pool is having multiple backends. the pool number decides from which pool the targets will be hit. I have used a javascript with a small logic to decide which pool member will be set as a target for a specific request. To change the pool1 to pool2 the self-service is there for the backend teams to switch their pool number.

Interesting! Thanks. I suppose the pools can be stored anywhere, not only in KVM.

You could use

  • a google sheet
  • Hashicorp Consul
  • or anything that exposes a query that uses HTTP GET

The Apigee proxy could query the pool data and select one using the simple JavaScript approach.

yes, we can use other storage than KVM. We are having proxy specific KVMs for other information, so I added the pool details in the KVM as well.