我正在尝试设置liquibase,以便基于aws-rds-aurora-mysql为一个项目同步我的dev和prod数据库。不幸的是,我无法将liquibase连接到我的aws aurora mysql数据库。
我做了什么?
液化气
跟随文章https://docs.aws.amazon.com/amazonrds/latest/aurorauserguide/aurora.connecting.html 说明了如何通过jdbc连接到aws-rds-aurora-mysql数据库集群。
我下载了mariadbjdbc连接器
我用附录1中的数据配置了liquibase.properties文件
我运行了命令'liquibase--driver=org.mariadb.jdbc.driver--classpath=<path\u to\u jar>mariadb-java-client-2.7.1.jar generatechangelog``
liquibase按预期启动并尝试连接到数据库prod集群,但随后挂起一段时间,然后终止,出现异常“communications link failure with primary”。找不到主服务器的活动连接。“-请参阅附录2中的stacktrace
我的问题是:
我必须如何配置liquibase才能在aws rds aurora mysql数据库集群上运行它?
感谢并向智能家居制造商致以最诚挚的问候
附录1:液化酶特性:
# Enter the path for your changelog file.
changeLogFile=<CHANGE_LOG_FILENAME>
#### Enter the Target database 'url' information ####
url=jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME>
# Enter the username for your Target database.
username: <PROD_DATABASE_USER>
# Enter the password for your Target database.
password: <PROD_DATABASE_PASSWORD>
#### Enter the Source Database 'referenceUrl' information ####
## The source database is the baseline or reference against which your target database is compared for diff/diffchangelog commands.
# Enter URL for the source database
referenceUrl: jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_DEV_CLUSTER>:<PORT_FOR_AWS_AURORA_DEV_CLUSTER>/<DEV_DATABASE_NAME>
# Enter the username for your source database
referenceUsername: <DEV_DATABASE_USER>
# Enter the password for your source database
referencePassword: <DEV_DATABASE_PASSWORD>
logLevel: DEBUG
附录2:stacktrace:
[2020-12-29 14:43:05] FEIN [liquibase.servicelocator] Loaded liquibase.license.LicenseService instance liquibase.pro.license.keymgr.DaticalTrueLicenseService
[2020-12-29 14:43:05] INFORMATION [liquibase.integration] No Liquibase Pro license key supplied. Please set liquibaseProLicenseKey on command line or in liquibase.properties to use Liquibase Pro features.
Liquibase Community 4.2.2 by Datical
####################################################
## _ _ _ _ ##
## | | (_) (_) | ##
## | | _ __ _ _ _ _| |__ __ _ ___ ___ ##
## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \ ##
## | |___| | (_| | |_| | | |_) | (_| \__ \ __/ ##
## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___| ##
## | | ##
## |_| ##
## ##
## Get documentation at docs.liquibase.com ##
## Get certified courses at learn.liquibase.com ##
## Free schema change activity reports at ##
## https://hub.liquibase.com ##
## ##
####################################################
Starte Liquibase am 14:43:05 (Version 4.2.2 #36, kompiliert am 2020-12-09 20:07+0000)
[2020-12-29 14:43:05] FEIN [liquibase.integration] 'file:<PATH_TO_JAR_FILE>mariadb-java-client-2.7.1.jar' will be added to Java Classpath.
[2020-12-29 14:43:05] FEIN [liquibase.integration] Liquibase Hub URL: https://hub.liquibase.com
[2020-12-29 14:43:05] FEIN [liquibase.integration] Liquibase Hub Mode: all
[2020-12-29 14:43:05] FEIN [liquibase.resource] Adding path <PATH_WHERE_LIQUIBASE_IS_RUNNING>. to resourceAccessor liquibase.resource.FileSystemResourceAccessor
[2020-12-29 14:43:05] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.CockroachDatabase
[2020-12-29 14:43:05] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.DB2Database
[2020-12-29 14:43:05] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.Db2zDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.DerbyDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.Firebird3Database
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.FirebirdDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.H2Database
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.HsqlDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.InformixDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.Ingres9Database
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.MSSQLDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.MariaDBDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.MockDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.MySQLDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.OracleDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.PostgresDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.SQLiteDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.SybaseASADatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.SybaseDatabase
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.database.core.UnsupportedDatabase
[2020-12-29 14:43:08] FEIN [liquibase.database] Properties:
[2020-12-29 14:43:08] FEIN [liquibase.database] Key:'password' Value:'**********'
[2020-12-29 14:43:08] FEIN [liquibase.database] Key:'user' Value:'***********'
[2020-12-29 14:43:08] FEIN [liquibase.database] Connecting to the URL:'jdbc:mariadb:aurora//jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME>' using driver:'org.mariadb.jdbc.Driver'
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.DatabaseConnection instance liquibase.database.jvm.JdbcConnection
[2020-12-29 14:43:08] FEIN [liquibase.servicelocator] Loaded liquibase.database.DatabaseConnection instance com.datical.liquibase.ext.database.jvm.ProJdbcConnection
Unexpected exception when executing liquibase: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:mariadb:aurora//jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME> with driver org.mariadb.jdbc.Driver. Communications link failure with primary. No active connection found for master.
Bitte verwenden Sie die '--logLevel'-Option, um mehr Informationen zu erhalten.
[2020-12-29 15:02:59] FATAL [liquibase.integration] Unexpected Exception when running liquibase: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:mariadb:aurora//jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME> with driver org.mariadb.jdbc.Driver. Communications link failure with primary. No active connection found for master.
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:mariadb:aurora//jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME> with driver org.mariadb.jdbc.Driver. Communications link failure with primary. No active connection found for master.
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:131)
at liquibase.integration.commandline.Main.doMigration(Main.java:1409)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:361)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Scope.child(Scope.java:226)
at liquibase.integration.commandline.Main$1.run(Main.java:360)
at liquibase.integration.commandline.Main$1.run(Main.java:193)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:193)
at liquibase.integration.commandline.Main.main(Main.java:156)
Caused by: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:mariadb:aurora//jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME> with driver org.mariadb.jdbc.Driver. Communications link failure with primary. No active connection found for master.
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:216)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:175)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:140)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:96)
... 14 more
Caused by: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:mariadb:aurora//jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME> with driver org.mariadb.jdbc.Driver. Communications link failure with primary. No active connection found for master.
at liquibase.database.ConnectionServiceFactory.create(ConnectionServiceFactory.java:36)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:213)
... 17 more
Caused by: liquibase.exception.DatabaseException: Connection could not be created to jdbc:mariadb:aurora//jdbc:mariadb:aurora//<ENDPOINT_URL_FOR_AWS_AURORA_PROD_CLUSTER>:<PORT_FOR_AWS_AURORA_PROD_CLUSTER>/<PROD_DATABASE_NAME> with driver org.mariadb.jdbc.Driver. Communications link failure with primary. No active connection found for master.
at liquibase.database.jvm.JdbcConnection.open(JdbcConnection.java:43)
at com.datical.liquibase.ext.database.jvm.ProJdbcConnection.open(Unknown Source)
at liquibase.database.ConnectionServiceFactory.create(ConnectionServiceFactory.java:33)
... 18 more
暂无答案!
目前还没有任何答案,快来回答吧!