server: port: 8800 spring: main: allow-bean-definition-overriding: true profiles: active: @profiles.active@ application: name: bunny-service # datasource: # # driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver # # url: jdbc:shardingsphere:classpath:static/shardingsphere.yaml # # type: com.zaxxer.hikari.HikariDataSource # driver-class-name: com.mysql.cj.jdbc.Driver # url: jdbc:mysql://${bunny.master.host}:${bunny.master.port}/${bunny.master.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true # username: ${bunny.master.username} # password: ${bunny.master.password} shardingsphere: datasource: names: master, slave1, slave2 master: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://${bunny.master.host}:${bunny.master.port}/${bunny.master.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true username: ${bunny.master.username} password: ${bunny.master.password} slave1: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://${bunny.slave1.host}:${bunny.slave1.port}/${bunny.slave1.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true username: ${bunny.slave1.username} password: ${bunny.slave1.password} slave2: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://${bunny.slave2.host}:${bunny.slave2.port}/${bunny.slave2.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true username: ${bunny.slave2.username} password: ${bunny.slave2.password} rules: readwrite-splitting: data-sources: readwrite_ds: static-strategy: write-data-source-name: master read-data-source-names: slave1, slave2 load-balancer-name: round_robin load-balancers: round_robin: type: ROUND_ROBIN sharding: default-database-strategy: hint: sharding-algorithm-name: master jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 mybatis-plus: mapper-locations: classpath:mapper/*.xml configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 查看日志 logging: pattern: dateformat: HH:mm:ss:SSS file: path: "logs/${spring.application.name}"