测试平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
4.5 KiB

1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
  1. --- # 数据源配置
  2. spring:
  3. datasource:
  4. type: com.zaxxer.hikari.HikariDataSource
  5. # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
  6. dynamic:
  7. # 性能分析插件(有性能损耗 不建议生产环境使用)
  8. p6spy: false
  9. # 设置默认的数据源或者数据源组,默认值即为 master
  10. primary: master
  11. # 严格模式 匹配不到数据源则报错
  12. strict: true
  13. datasource:
  14. # 主库数据源
  15. master:
  16. type: ${spring.datasource.type}
  17. driverClassName: com.mysql.cj.jdbc.Driver
  18. # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
  19. # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
  20. url: jdbc:mysql://ly:3306/test_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
  21. username: root
  22. password: 123456
  23. # 从库数据源
  24. sensitiveDb:
  25. lazy: true
  26. type: ${spring.datasource.type}
  27. driverClassName: com.mysql.cj.jdbc.Driver
  28. url: jdbc:mysql://ly:3306/test_p_sensitive_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
  29. username: root
  30. password: 123456
  31. hikari:
  32. # 最大连接池数量
  33. maxPoolSize: 20
  34. # 最小空闲线程数量
  35. minIdle: 10
  36. # 配置获取连接等待超时的时间
  37. connectionTimeout: 30000
  38. # 校验超时时间
  39. validationTimeout: 5000
  40. # 空闲连接存活最大时间,默认10分钟
  41. idleTimeout: 600000
  42. # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
  43. maxLifetime: 1800000
  44. # 多久检查一次连接的活性
  45. keepaliveTime: 30000
  46. --- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
  47. spring:
  48. redis:
  49. # 地址
  50. host: ly
  51. # 端口,默认为6379
  52. port: 6379
  53. # 数据库索引
  54. database: 4
  55. # 密码(如没有密码请注释掉)
  56. password: 123456
  57. # 连接超时时间
  58. timeout: 10s
  59. # 是否开启ssl
  60. ssl: false
  61. redisson:
  62. # redis key前缀
  63. keyPrefix:
  64. # 线程池数量
  65. threads: 4
  66. # Netty线程池数量
  67. nettyThreads: 8
  68. # 单节点配置
  69. singleServerConfig:
  70. # 客户端名称
  71. clientName: ${testplatform.name}
  72. # 最小空闲连接数
  73. connectionMinimumIdleSize: 8
  74. # 连接池大小
  75. connectionPoolSize: 32
  76. # 连接空闲超时,单位:毫秒
  77. idleConnectionTimeout: 10000
  78. # 命令等待超时,单位:毫秒
  79. timeout: 3000
  80. # 发布和订阅连接池大小
  81. subscriptionConnectionPoolSize: 50
  82. --- # mail 邮件发送
  83. mail:
  84. enabled: false
  85. host: smtp.163.com
  86. port: 465
  87. # 是否需要用户名密码验证
  88. auth: true
  89. # 发送方,遵循RFC-822标准
  90. from: xxx@163.com
  91. # 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
  92. user: xxx@163.com
  93. # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
  94. pass: xxxxxxxxxx
  95. # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
  96. starttlsEnable: true
  97. # 使用SSL安全连接
  98. sslEnable: true
  99. # SMTP超时时长,单位毫秒,缺省值不超时
  100. timeout: 0
  101. # Socket连接超时值,单位毫秒,缺省值不超时
  102. connectionTimeout: 0
  103. --- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
  104. # https://wind.kim/doc/start 文档地址 各个厂商可同时使用
  105. sms:
  106. # 阿里云 dysmsapi.aliyuncs.com
  107. alibaba:
  108. #请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置
  109. requestUrl: dysmsapi.aliyuncs.com
  110. #阿里云的accessKey
  111. accessKeyId: xxxxxxx
  112. #阿里云的accessKeySecret
  113. accessKeySecret: xxxxxxx
  114. #短信签名
  115. signature: 测试
  116. tencent:
  117. #请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置
  118. requestUrl: sms.tencentcloudapi.com
  119. #腾讯云的accessKey
  120. accessKeyId: xxxxxxx
  121. #腾讯云的accessKeySecret
  122. accessKeySecret: xxxxxxx
  123. #短信签名
  124. signature: 测试
  125. #短信sdkAppId
  126. sdkAppId: appid
  127. #地域信息默认为 ap-guangzhou 如无特殊改变可不用设置
  128. territory: ap-guangzhou