Store and redirect HTTP requests with duplicates?

Twilio and other HTTP-driven web services have the concept of a fallback URL where web services send GET or POST to the URL of your choice if the main URL expires or otherwise fails. In the case of Twilio, they will not repeat the request if the backup URL also fails. I would like the backup URL to be hosted on a separate machine so that the error does not get lost on the air if the main server is unavailable or unavailable.

I would like to somehow go to the secondary:

  • Save fallback URL requests
  • Retry requests to a slightly different URL on the primary server
  • Repeat # 2 until successful, then remove the request from the queue / database

Is there any existing piece of software that can do this? I can build something by myself, if necessary, I just thought that it would be something that someone would already do. I do not know enough about HTTP and the surrounding tools (proxies, reverse proxies, etc.) to find out the right word for search.

+6
source share
1 answer

There are several possibilities.

One option is to use the Common Address Redundancy Protocol or carp. The following is a brief description on the manual page.

"carp allows multiple hosts on the same LAN to share a set of IP addresses. Its main purpose is to ensure that these addresses are always available, but in some configurations the carp can also provide load balancing functionality.

It should be possible to adjust IP address balancing so that if the primary or primary http service fails, the secondary or backup http service becomes the master. carp is host oriented, not application centric. Therefore, when the http service goes down, it also needs to remove the network interface for the carp to do its job. This means that you will need more than one IP address to log in and perform maintenance. You will need a script to complete the next steps after the original service returns to the network.

The second option is to use nginx. This is probably better for what you are trying to do.

Many years ago, I needed something similar to what they were trying to do, and I ended up hacking something that did it. In fact, it was a switch. When “A” fails, switch to “B”. The re-synchronization process was to take time stamped logs from “B” and play them back to “A” once “A” was online again.

+3
source

Source: https://habr.com/ru/post/950678/


All Articles