中国算力平台算力登记系统2.0
yanzhaofeige
2024-09-30 f21d302f4ccb816ca2d411544b5ff8bd4f9d4cac
commit | author | age
43dc29 1 # 数据源配置
Y 2 spring:
3     datasource:
4         type: com.alibaba.druid.pool.DruidDataSource
5         driverClassName: com.mysql.cj.jdbc.Driver
6         druid:
7             # 主库数据源
8             master:
9                 url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
10                 username: root
11                 password: password
12             # 从库数据源
13             slave:
14                 # 从数据源开关/默认关闭
15                 enabled: false
16                 url: 
17                 username: 
18                 password: 
19             # 初始连接数
20             initialSize: 5
21             # 最小连接池数量
22             minIdle: 10
23             # 最大连接池数量
24             maxActive: 20
25             # 配置获取连接等待超时的时间
26             maxWait: 60000
27             # 配置连接超时时间
28             connectTimeout: 30000
29             # 配置网络超时时间
30             socketTimeout: 60000
31             # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
32             timeBetweenEvictionRunsMillis: 60000
33             # 配置一个连接在池中最小生存的时间,单位是毫秒
34             minEvictableIdleTimeMillis: 300000
35             # 配置一个连接在池中最大生存的时间,单位是毫秒
36             maxEvictableIdleTimeMillis: 900000
37             # 配置检测连接是否有效
38             validationQuery: SELECT 1 FROM DUAL
39             testWhileIdle: true
40             testOnBorrow: false
41             testOnReturn: false
42             webStatFilter: 
43                 enabled: true
44             statViewServlet:
45                 enabled: true
46                 # 设置白名单,不填则允许所有访问
47                 allow:
48                 url-pattern: /druid/*
49                 # 控制台管理用户名和密码
50                 login-username: ruoyi
51                 login-password: 123456
52             filter:
53                 stat:
54                     enabled: true
55                     # 慢SQL记录
56                     log-slow-sql: true
57                     slow-sql-millis: 1000
58                     merge-sql: true
59                 wall:
60                     config:
61                         multi-statement-allow: true