From 02c5d44f0b431ea1902ec1aed7167e932930d3b3 Mon Sep 17 00:00:00 2001 From: Nick Livens Date: Mon, 23 May 2016 15:50:28 +0200 Subject: [PATCH] Dynamic loading of DB driver + support for other DB providers --- build/replace.properties | 1 + client/tomcatconf/db.properties.in | 3 ++ .../snapshot/test/resources/db.properties | 5 +++ .../com/cloud/utils/db/TransactionLegacy.java | 44 ++++++++++++++----- framework/db/test/db.properties | 5 +++ framework/jobs/test/resources/db.properties | 5 +++ packaging/centos63/replace.properties | 1 + packaging/centos7/replace.properties | 1 + packaging/centos7/tomcat7/db.properties | 5 +++ packaging/debian/replace.properties | 1 + packaging/fedora20/replace.properties | 1 + packaging/fedora21/replace.properties | 1 + .../globodns/test/resources/db.properties | 5 +++ .../test/resources/db.properties | 5 +++ server/test/resources/db.properties | 5 +++ .../iam/plugin/test/resources/db.properties | 5 +++ .../iam/server/test/resources/db.properties | 5 +++ tools/devcloud-kvm/pom.xml | 2 +- tools/devcloud/pom.xml | 2 +- tools/devcloud4/pom.xml | 2 +- usage/conf/db.properties.in | 1 + usage/test/resources/db.properties | 5 +++ utils/conf/db.properties | 5 +++ 23 files changed, 100 insertions(+), 15 deletions(-) diff --git a/build/replace.properties b/build/replace.properties index 3983b1031c1..9e0b65c6901 100644 --- a/build/replace.properties +++ b/build/replace.properties @@ -21,6 +21,7 @@ DBROOTPW= MSLOG=vmops.log APISERVERLOG=api.log DBHOST=localhost +DBDRIVER=jdbc:mysql AGENTLOGDIR=logs AGENTLOG=logs/agent.log MSMNTDIR=/mnt diff --git a/client/tomcatconf/db.properties.in b/client/tomcatconf/db.properties.in index 74b926306eb..1c2b55f3b86 100644 --- a/client/tomcatconf/db.properties.in +++ b/client/tomcatconf/db.properties.in @@ -25,6 +25,7 @@ region.id=1 db.cloud.username=@DBUSER@ db.cloud.password=@DBPW@ db.cloud.host=@DBHOST@ +db.cloud.driver=@DBDRIVER@ db.cloud.port=3306 db.cloud.name=cloud @@ -56,6 +57,7 @@ db.cloud.encrypt.secret= db.usage.username=@DBUSER@ db.usage.password=@DBPW@ db.usage.host=@DBHOST@ +db.usage.driver=@DBDRIVER@ db.usage.port=3306 db.usage.name=cloud_usage @@ -69,6 +71,7 @@ db.usage.url.params= db.simulator.username=@DBUSER@ db.simulator.password=@DBPW@ db.simulator.host=@DBHOST@ +db.simulator.driver=@DBDRIVER@ db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/engine/storage/snapshot/test/resources/db.properties b/engine/storage/snapshot/test/resources/db.properties index a458b2306f4..e8e94121fe1 100644 --- a/engine/storage/snapshot/test/resources/db.properties +++ b/engine/storage/snapshot/test/resources/db.properties @@ -26,6 +26,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -46,6 +47,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -59,6 +62,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java index af834ca115e..523162e2220 100644 --- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java +++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java @@ -20,6 +20,8 @@ import java.io.Closeable; import java.io.File; import java.io.IOException; import java.sql.Connection; +import java.sql.Driver; +import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -1024,6 +1026,7 @@ public class TransactionLegacy implements Closeable { final String cloudUsername = dbProps.getProperty("db.cloud.username"); final String cloudPassword = dbProps.getProperty("db.cloud.password"); final String cloudHost = dbProps.getProperty("db.cloud.host"); + final String cloudDriver = dbProps.getProperty("db.cloud.driver"); final int cloudPort = Integer.parseInt(dbProps.getProperty("db.cloud.port")); final String cloudDbName = dbProps.getProperty("db.cloud.name"); final boolean cloudAutoReconnect = Boolean.parseBoolean(dbProps.getProperty("db.cloud.autoReconnect")); @@ -1072,10 +1075,12 @@ public class TransactionLegacy implements Closeable { new GenericObjectPool(null, cloudMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, cloudMaxWait, cloudMaxIdle, cloudTestOnBorrow, false, cloudTimeBtwEvictionRunsMillis, 1, cloudMinEvcitableIdleTimeMillis, cloudTestWhileIdle); - final ConnectionFactory cloudConnectionFactory = - new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + (s_dbHAEnabled ? "," + cloudSlaves : "") + ":" + cloudPort + "/" + cloudDbName + - "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : "") + - (s_dbHAEnabled ? "&" + cloudDbHAParams : "") + (s_dbHAEnabled ? "&loadBalanceStrategy=" + loadBalanceStrategy : ""), cloudUsername, cloudPassword); + final String cloudConnectionUri = cloudDriver + "://" + cloudHost + (s_dbHAEnabled ? "," + cloudSlaves : "") + ":" + cloudPort + "/" + cloudDbName + + "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : "") + + (s_dbHAEnabled ? "&" + cloudDbHAParams : "") + (s_dbHAEnabled ? "&loadBalanceStrategy=" + loadBalanceStrategy : ""); + loadDbDriver(cloudConnectionUri); + + final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory(cloudConnectionUri, cloudUsername, cloudPassword); final KeyedObjectPoolFactory poolableObjFactory = (cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null); @@ -1092,6 +1097,7 @@ public class TransactionLegacy implements Closeable { final String usageUsername = dbProps.getProperty("db.usage.username"); final String usagePassword = dbProps.getProperty("db.usage.password"); final String usageHost = dbProps.getProperty("db.usage.host"); + final String usageDriver = dbProps.getProperty("db.usage.driver"); final int usagePort = Integer.parseInt(dbProps.getProperty("db.usage.port")); final String usageDbName = dbProps.getProperty("db.usage.name"); final boolean usageAutoReconnect = Boolean.parseBoolean(dbProps.getProperty("db.usage.autoReconnect")); @@ -1100,11 +1106,12 @@ public class TransactionLegacy implements Closeable { final GenericObjectPool usageConnectionPool = new GenericObjectPool(null, usageMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, usageMaxWait, usageMaxIdle); - final ConnectionFactory usageConnectionFactory = - new DriverManagerConnectionFactory("jdbc:mysql://" + usageHost + (s_dbHAEnabled ? "," + dbProps.getProperty("db.cloud.slaves") : "") + ":" + usagePort + - "/" + usageDbName + "?autoReconnect=" + usageAutoReconnect + (usageUrl != null ? "&" + usageUrl : "") + - (s_dbHAEnabled ? "&" + getDBHAParams("usage", dbProps) : "") + (s_dbHAEnabled ? "&loadBalanceStrategy=" + loadBalanceStrategy : ""), usageUsername, - usagePassword); + final String usageConnectionUri = usageDriver + "://" + usageHost + (s_dbHAEnabled ? "," + dbProps.getProperty("db.cloud.slaves") : "") + ":" + usagePort + + "/" + usageDbName + "?autoReconnect=" + usageAutoReconnect + (usageUrl != null ? "&" + usageUrl : "") + + (s_dbHAEnabled ? "&" + getDBHAParams("usage", dbProps) : "") + (s_dbHAEnabled ? "&loadBalanceStrategy=" + loadBalanceStrategy : ""); + loadDbDriver(usageConnectionUri); + + final ConnectionFactory usageConnectionFactory = new DriverManagerConnectionFactory(usageConnectionUri, usageUsername, usagePassword); final PoolableConnectionFactory usagePoolableConnectionFactory = new PoolableConnectionFactory(usageConnectionFactory, usageConnectionPool, new StackKeyedObjectPoolFactory(), null, false, false); @@ -1120,6 +1127,7 @@ public class TransactionLegacy implements Closeable { final String simulatorUsername = dbProps.getProperty("db.simulator.username"); final String simulatorPassword = dbProps.getProperty("db.simulator.password"); final String simulatorHost = dbProps.getProperty("db.simulator.host"); + final String simulatorDriver = dbProps.getProperty("db.simulator.driver"); final int simulatorPort = Integer.parseInt(dbProps.getProperty("db.simulator.port")); final String simulatorDbName = dbProps.getProperty("db.simulator.name"); final boolean simulatorAutoReconnect = Boolean.parseBoolean(dbProps.getProperty("db.simulator.autoReconnect")); @@ -1127,9 +1135,11 @@ public class TransactionLegacy implements Closeable { final GenericObjectPool simulatorConnectionPool = new GenericObjectPool(null, simulatorMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, simulatorMaxWait, simulatorMaxIdle); - final ConnectionFactory simulatorConnectionFactory = - new DriverManagerConnectionFactory("jdbc:mysql://" + simulatorHost + ":" + simulatorPort + "/" + simulatorDbName + "?autoReconnect=" + - simulatorAutoReconnect, simulatorUsername, simulatorPassword); + final String simulatorConnectionUri = simulatorDriver + "://" + simulatorHost + ":" + simulatorPort + "/" + simulatorDbName + "?autoReconnect=" + + simulatorAutoReconnect; + loadDbDriver(simulatorConnectionUri); + + final ConnectionFactory simulatorConnectionFactory = new DriverManagerConnectionFactory(simulatorConnectionUri, simulatorUsername, simulatorPassword); final PoolableConnectionFactory simulatorPoolableConnectionFactory = new PoolableConnectionFactory(simulatorConnectionFactory, simulatorConnectionPool, new StackKeyedObjectPoolFactory(), null, false, false); @@ -1147,6 +1157,16 @@ public class TransactionLegacy implements Closeable { } } + private static void loadDbDriver(String dbConnectionUri) { + try { + Driver driver = DriverManager.getDriver(dbConnectionUri); + s_logger.debug("Successfully loaded DB driver " + driver.getClass().getName() + " for connection " + dbConnectionUri); + } catch (SQLException e) { + s_logger.error("Failed to load DB driver for connection " + dbConnectionUri, e); + throw new CloudRuntimeException("Failed to load DB driver for connection " + dbConnectionUri, e); + } + } + private static String getDBHAParams(String dbName, Properties dbProps) { StringBuilder sb = new StringBuilder(); sb.append("failOverReadOnly=" + dbProps.getProperty("db." + dbName + ".failOverReadOnly")); diff --git a/framework/db/test/db.properties b/framework/db/test/db.properties index 49fd68aa933..c7aeaad2642 100644 --- a/framework/db/test/db.properties +++ b/framework/db/test/db.properties @@ -29,6 +29,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -49,6 +50,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -62,6 +65,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/framework/jobs/test/resources/db.properties b/framework/jobs/test/resources/db.properties index 9d250ba8b0a..235de858697 100644 --- a/framework/jobs/test/resources/db.properties +++ b/framework/jobs/test/resources/db.properties @@ -22,6 +22,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -42,6 +43,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -55,6 +58,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/packaging/centos63/replace.properties b/packaging/centos63/replace.properties index 6a3101f9b57..bdf6e223b59 100644 --- a/packaging/centos63/replace.properties +++ b/packaging/centos63/replace.properties @@ -21,6 +21,7 @@ DBROOTPW= MSLOG=vmops.log APISERVERLOG=api.log DBHOST=localhost +DBDRIVER=jdbc:mysql COMPONENTS-SPEC=components-premium.xml REMOTEHOST=localhost AGENTCLASSPATH= diff --git a/packaging/centos7/replace.properties b/packaging/centos7/replace.properties index aec359e2e6c..0b0f2cc12dd 100644 --- a/packaging/centos7/replace.properties +++ b/packaging/centos7/replace.properties @@ -21,6 +21,7 @@ DBROOTPW= MSLOG=vmops.log APISERVERLOG=api.log DBHOST=localhost +DBDRIVER=jdbc:mysql COMPONENTS-SPEC=components-premium.xml REMOTEHOST=localhost AGENTCLASSPATH= diff --git a/packaging/centos7/tomcat7/db.properties b/packaging/centos7/tomcat7/db.properties index 36ade8ce86e..6161f3a6e2a 100644 --- a/packaging/centos7/tomcat7/db.properties +++ b/packaging/centos7/tomcat7/db.properties @@ -25,6 +25,7 @@ region.id=1 db.cloud.username=cloud db.cloud.password=ENC(vlzQjmqOV4s5q7n+S1OMbA==) db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -56,6 +57,8 @@ db.cloud.encrypt.secret=ENC(zaGuSF5a4KyWayn2t0yyjDa0HjdToVtZ) db.usage.password=ENC(cQEcN5aVucSYK+WUkPjDcw==) db.usage.username=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -69,6 +72,8 @@ db.usage.url.params= db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/packaging/debian/replace.properties b/packaging/debian/replace.properties index 6d55a988207..e1d28bb9549 100644 --- a/packaging/debian/replace.properties +++ b/packaging/debian/replace.properties @@ -21,6 +21,7 @@ DBROOTPW= MSLOG=vmops.log APISERVERLOG=api.log DBHOST=localhost +DBDRIVER=jdbc:mysql COMPONENTS-SPEC=components-premium.xml REMOTEHOST=localhost AGENTCLASSPATH= diff --git a/packaging/fedora20/replace.properties b/packaging/fedora20/replace.properties index 6a3101f9b57..bdf6e223b59 100644 --- a/packaging/fedora20/replace.properties +++ b/packaging/fedora20/replace.properties @@ -21,6 +21,7 @@ DBROOTPW= MSLOG=vmops.log APISERVERLOG=api.log DBHOST=localhost +DBDRIVER=jdbc:mysql COMPONENTS-SPEC=components-premium.xml REMOTEHOST=localhost AGENTCLASSPATH= diff --git a/packaging/fedora21/replace.properties b/packaging/fedora21/replace.properties index 6a3101f9b57..bdf6e223b59 100644 --- a/packaging/fedora21/replace.properties +++ b/packaging/fedora21/replace.properties @@ -21,6 +21,7 @@ DBROOTPW= MSLOG=vmops.log APISERVERLOG=api.log DBHOST=localhost +DBDRIVER=jdbc:mysql COMPONENTS-SPEC=components-premium.xml REMOTEHOST=localhost AGENTCLASSPATH= diff --git a/plugins/network-elements/globodns/test/resources/db.properties b/plugins/network-elements/globodns/test/resources/db.properties index 6ebe10af5fd..6e38a4a6f32 100644 --- a/plugins/network-elements/globodns/test/resources/db.properties +++ b/plugins/network-elements/globodns/test/resources/db.properties @@ -27,6 +27,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -47,6 +48,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -60,6 +63,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/plugins/network-elements/juniper-contrail/test/resources/db.properties b/plugins/network-elements/juniper-contrail/test/resources/db.properties index 9d250ba8b0a..235de858697 100644 --- a/plugins/network-elements/juniper-contrail/test/resources/db.properties +++ b/plugins/network-elements/juniper-contrail/test/resources/db.properties @@ -22,6 +22,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -42,6 +43,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -55,6 +58,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/server/test/resources/db.properties b/server/test/resources/db.properties index 45baf4cf975..e9355a3db35 100644 --- a/server/test/resources/db.properties +++ b/server/test/resources/db.properties @@ -26,6 +26,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -46,6 +47,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -59,6 +62,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/services/iam/plugin/test/resources/db.properties b/services/iam/plugin/test/resources/db.properties index faa577c982b..a672d63f799 100644 --- a/services/iam/plugin/test/resources/db.properties +++ b/services/iam/plugin/test/resources/db.properties @@ -27,6 +27,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -47,6 +48,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -60,6 +63,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/services/iam/server/test/resources/db.properties b/services/iam/server/test/resources/db.properties index faa577c982b..a672d63f799 100644 --- a/services/iam/server/test/resources/db.properties +++ b/services/iam/server/test/resources/db.properties @@ -27,6 +27,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -47,6 +48,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -60,6 +63,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/tools/devcloud-kvm/pom.xml b/tools/devcloud-kvm/pom.xml index a71968e95d2..b0e12341c3d 100644 --- a/tools/devcloud-kvm/pom.xml +++ b/tools/devcloud-kvm/pom.xml @@ -83,7 +83,7 @@ org.gjt.mm.mysql.Driver - jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud + ${db.cloud.driver}://${db.cloud.host}:${db.cloud.port}/cloud ${db.cloud.username} ${db.cloud.password} diff --git a/tools/devcloud/pom.xml b/tools/devcloud/pom.xml index e8bcaebe606..8644ff45a5a 100644 --- a/tools/devcloud/pom.xml +++ b/tools/devcloud/pom.xml @@ -83,7 +83,7 @@ org.gjt.mm.mysql.Driver - jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud + ${db.cloud.driver}://${db.cloud.host}:${db.cloud.port}/cloud ${db.cloud.username} ${db.cloud.password} diff --git a/tools/devcloud4/pom.xml b/tools/devcloud4/pom.xml index 47493931ba7..e3cee0c2b8e 100644 --- a/tools/devcloud4/pom.xml +++ b/tools/devcloud4/pom.xml @@ -83,7 +83,7 @@ org.gjt.mm.mysql.Driver - jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud + ${db.cloud.driver}://${db.cloud.host}:${db.cloud.port}/cloud ${db.cloud.username} ${db.cloud.password} diff --git a/usage/conf/db.properties.in b/usage/conf/db.properties.in index 0dd49ede8b2..35a40def7b1 100644 --- a/usage/conf/db.properties.in +++ b/usage/conf/db.properties.in @@ -19,6 +19,7 @@ db.usage.username=@DBUSER@ db.usage.password=@DBPW@ db.usage.host=@DBHOST@ +db.usage.driver=@DBDRIVER@ db.usage.port=3306 db.usage.name=cloud_usage diff --git a/usage/test/resources/db.properties b/usage/test/resources/db.properties index a458b2306f4..e8e94121fe1 100644 --- a/usage/test/resources/db.properties +++ b/usage/test/resources/db.properties @@ -26,6 +26,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -46,6 +47,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -59,6 +62,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250 diff --git a/utils/conf/db.properties b/utils/conf/db.properties index 49fd68aa933..c7aeaad2642 100644 --- a/utils/conf/db.properties +++ b/utils/conf/db.properties @@ -29,6 +29,7 @@ db.cloud.username=cloud db.cloud.password=cloud db.root.password= db.cloud.host=localhost +db.cloud.driver=jdbc:mysql db.cloud.port=3306 db.cloud.name=cloud @@ -49,6 +50,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi db.usage.username=cloud db.usage.password=cloud db.usage.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.usage.driver=jdbc:mysql db.usage.port=3306 db.usage.name=cloud_usage @@ -62,6 +65,8 @@ db.usage.autoReconnect=true db.simulator.username=cloud db.simulator.password=cloud db.simulator.host=localhost +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work +db.simulator.driver=jdbc:mysql db.simulator.port=3306 db.simulator.name=simulator db.simulator.maxActive=250