After migration to new PROD server start getting error from some inactivity period
On previous server I’ve already had Broken Pipe error with MySQL and successfully solved it with http://sacharya.com/grails-dbcp-stale-connections/
But on new server (Red Hat Enterprise Linux) it failed.
After digging a lot I found http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai and some other topics which helped.
Resulted config which fix problem is following:
- On server in /etc/hosts.allow added ‘mysqld : ALL : ACCEPT’
- On server in /etc/my.cf added ‘port=3306′
- In DataSource.groovy added properties
- In DataSource.groovy changed datadase URL to have IP (127.0.0.1) instead of localhost: ‘jdbc:mysql://127.0.0.1:3306/db_name’