我正在尝试使用Flyway-Commandline连接到Oracle Cluster。它可以在DOS下正常使用:
# Ommitting the other params for brevity: jarDir, locations, user, password, driver etc
flyway clean -url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST = my_host_1)(PORT=8020))(ADDRESS=(PROTOCOL=TCP)(HOST = my_host_2)(PORT=8020))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MY_SERVICE_NAME)))"
但是当我在linux上做同样的事情时,我得到一个错误:
ERROR: FlywayException: Unable to obtain Jdbc connection from DataSource
ERROR: Occured in com.googlecode.flyway.core.util.jdbc.JdbcUtils.openConnection() at line 56
ERROR: Caused by oracle.net.ns.NetException: NL Exception was generated
ERROR: Occured in oracle.net.resolver.AddrResolution.resolveAddrTree() at line 626
如果我直接使用以下命令直接连接到其中一个主机,它在两个平台上都能正常工作:
flyway clean -url=jdbc:oracle:thin:@my_host_1:8020/MY_SERVICE_NAME
问题在于当群集中的一台主机出现故障时(定期发生),这将停止工作。
答案 0 :(得分:0)
这听起来像是Linux环境的问题,而不是Flyway本身的问题。