最近、データベースを mysql から mariadb への 2 ノード クラスター データベースでのレプリケーションをサポートするように移行しました。データベースは別のドメインでホストされており、ELB を介してアクセスされます。アプリケーションをノードの 1 つにポイントすると、アプリケーションは正常に動作しますが、ELB URL を使用してデータベースに接続すると、ランダムに変動し、followint エラーが頻繁に表示されます
Communication Link Failure
could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query
これが私のデータソース構成です:-
dataSource {
shard = false
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
dbCreate = "update" // one of 'create', 'create-drop','update'
properties {
initialSize=5
maxActive=50
minIdle=5
maxIdle=25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis=5000
minEvictableIdleTimeMillis=60000
validationQuery="SELECT 1"
validationInterval=15000
testWhileIdle=true
testOnBorrow=true
testOnReturn=false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
誰でも問題を特定し、可能な解決策を提供できますか