Liferay application servers getting unresponsive while switching the database
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
- There is a setup of two nodes of PostgreSQL database along with a Virtual IP address between both database nodes in which while switching over of database, the application servers remain unresponsive until restarts the Liferay application server.
Environment
Resolution
-
Liferay is not tested with any Database clustering solutions. However, it can be considered to be working if the database cluster is seen as a single database connection at the JNDI level. The reason why Liferay is failing after the switching of the DB is that Liferay builds up a connection pool towards the database server and maintains it while the system is up and running. If the database cluster works in the background as a single robust database server it shouldn't cause any issues.
Currently, in this scenario, what's happening here is that the PG Cluster does not replicate the connections, so when one of the nodes goes away, the connections from the connection pool gets unusable and in the logs, the below exception can be observed
org.postgresql.util.PSQLException: This connection has been closed.
That's the reason the system remains without a working database connection, and there's nothing Liferay could do about it without restart.
- In this matter need to connect to the DB admin for the same to see what would be right parameters or configuration needs to be set based on the affected environment architecture as this needs to be done at the DB level and not at Liferay level.
Did this article resolve your issue ?