2016-07-27 50 views
0

Ich bin mit einem Konfigurationsproblem in IBM BlueMix konfrontiert. Ich habe 2 Artikel ausgeführt wird, die bereits verbunden sind:IBM BlueMix: TomCat ROOT.xml Anpassung für DB-Verbindung

  1. TomCat
  2. ClearDB

Innerhalb TomCat eine Anwendung eingesetzt wird (LifeRay), die scheinen über nutzen, um die vorgesehenen Verbindungspool von ClearDB (4 Anschlüsse):

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: User 'xxxxx' has exceeded the 'max_user_connections' resource (current value: 4) 

Innerhalb meiner Anwendung angegeben ich eine Einschränkung (siehe letzte Zeile):

liferay.home=/home/vcap/app/.java-buildpack/tomcat/webapps/ROOT/WEB-INF 
jdbc.default.driverClassName=com.mysql.jdbc.Driver 
jdbc.default.url=jdbc:mysql://us-cdbr-iron-east-04.cleardb.net/xxxxx?user=xxxxx&password=xxxxx 
jdbc.default.username=xxxxx 
jdbc.default.password=xxxxx 
jdbc.default.maxPoolSize=4 

Die Verbindung wird erfolgreich hergestellt. Ich lande jedoch in der erwähnten Ausnahme, die den Droplet zum Absturz bringt; dies verhindert, dass ich auch ROOT.xml von TomCat zu überprüfen:

App instance exited with guid c2ec8b5e-1b11-42f0-82e8-b58960598be6 payload: {"cc_partition"=>"default", "droplet"=>"c2ec8b5e-1b11-42f0-82e8-b58960598be6", "version"=>"184afb88-2499-49cd-9ed1-f0cb5d042607", "instance"=>"88d43ee42795422c97a6add2b453602a", "index"=>0, "reason"=>"CRASHED", "exit_status"=>148, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1469615393} 

Da die Konfigurationsdatei verwendet wird, scheint nicht, nehme ich an, dass TomCat ist falsch konfigurierte von CloudFoundy. Irgendeine Idee, wie man TomCat konfiguriert, um den Verbindungspool zu begrenzen?

Dies ist ein Spielplatz für mich (PoC); Leistung spielt keine Rolle; BlueMix scheint keine andere freie Datenbank zum Testen verfügbar zu haben, die mehr Verbindungen bietet.

Jede Hilfe wird sehr geschätzt!

Antwort

0

Die Verbindungen Pool kann über portal-ext.properties konfiguriert werden:

# Connection Pool (Default: C3PO) 
jdbc.default.liferay.pool.provider=c3po 
jdbc.default.acquireIncrement=5 
jdbc.default.acquireRetryAttempts=3 
jdbc.default.acquireRetryDelay=1000 

jdbc.default.connectionCustomizerClassName=com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer 
jdbc.default.idleConnectionTestPeriod=3600 
jdbc.default.maxIdleTime=3600 
jdbc.default.maxPoolSize=20 
jdbc.default.minPoolSize=5 
jdbc.default.initialPoolSize=10 
jdbc.default.numHelperThreads=10 
#jdbc.default.transactionIsolation=1