[英]connecting from spring-boot to PostgreSQL replica
We just set up a PostgreSQL replica (master-slave).我们只是设置了一个 PostgreSQL 副本(主从)。
We also setup repmgr for automatic failover.我们还为自动故障转移设置了 repmgr。
Our application is using spring-boot.我们的应用程序使用 spring-boot。
If the master fails, we need the application to connect transparently to the current primary (previously standby).如果主服务器发生故障,我们需要应用程序透明地连接到当前主服务器(之前的备用服务器)。
How can we set this up in the connection string?我们如何在连接字符串中设置它?
This format worked: jdbc:postgresql://host1:port1,host2:port2/database这种格式有效:jdbc:postgresql://host1:port1,host2:port2/database
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.