简体   繁体   English

从 spring-boot 连接到 PostgreSQL 副本

[英]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.

相关问题 将 Spring 引导连接到 PostgreSQL 失败 - Connecting Spring Boot to PostgreSQL fails 连接时从 Spring 引导项目到 PostgreSQL 数据库的连接问题 - Connection issue from Spring Boot projects to PostgreSQL database while connecting 将Spring Boot Web应用程序连接到postgresql服务器 - Connecting Spring Boot web app to a postgresql server 身份验证问题:在 docker 上运行 postgresql 的 spring-boot 应用程序 - Authentication issue: spring-boot application with postgresql running on docker 如何使用spring-boot和postgresql的postgis类型地理? - How to use postgis type Geography with spring-boot and postgresql? Spring-Boot PostgreSQL尝试连接时抛出异常? - Spring-Boot PostgreSQL exception thrown trying to connect? 访问 postgresql 数据库导致 Spring-Boot 出现语法错误 - Syntax Error in Spring-Boot by eccessing postgresql database 从Spring Boot应用程序连接数据库时org.postgresql.util.PSQLException - org.postgresql.util.PSQLException while connecting database from spring boot application 无法使用 spring-boot、spring-data-jpa 和 hibernate 空间在 ZE4728Fdb044B249BCBADE9 上进行地理空间查询(内部) - Unable to make geospatial query (within) with spring-boot, spring-data-jpa and hibernate spatial on postgresql db 使用JPA / Hibernate将Spring Boot连接到PostgreSql数据库时失败 - Failure while connecting Spring Boot to PostgreSql database using JPA/Hibernate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM