在 Spring Boot 中使用 YAML 文件配置连接 Galera MySQL 集群的生产环境的配置文件应该包含以下内容:
spring:
datasource:
type: com.github.fedorchuck.jsqlb.JSQLConnectionsPool
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql:replication://<host1>,<host2>,<host3>/<dbname>
username: <username>
password: <password>
initialization-mode: always
connection-timeout: 5000
idle-timeout: 60000
max-lifetime: 1800000
maximum-pool-size: 10