I have inherited a tomcat application running on RHEL that connects to a local postgres database. We have a total of 8 servers in multiple states running this. Each server actually has two different postgres databases on it. Each day we switch back and forth from one database to the other and the non-live database then gets replaced with new data to switch back the next day.
We are using redir to redirect the database connection in the application. By stopping the redir and re-starting it forwarding he new port we are able to point to the newest data.
The problem comes in when trying to stop the redir and getting FIN_WAITs which can cause a delay of up to a minute. Is there any way to use a redir so that existing connections continue to point to the old location but new ones point to the new port?