问题
In the context of a Docker setup, I want to use an ambassador-like pattern to allow some container (e.g., database server) to restart gracefully without having to restart all dependent containers (e.g., web server) and without error messages because "database server is not available".
Therefore, I was wondering: Is there a TCP proxy software (that would run in the ambassador container) that can accept and hold connections if the backend is down and re-establish them when it is back? In the case of web and database server, it should appear to the web server as if the database server just takes longer than usual to reply (like, 30 seconds), but will eventually answer the query.
Is such a thing possible at all? Is there a tool that can realize such a behavior?
来源:https://stackoverflow.com/questions/25031011/tcp-proxy-hold-connections-while-backend-is-unavailable