Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
14f868f1
Commit
14f868f1
authored
May 27, 2020
by
tangzhaoqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据源配置
parent
c781f754
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
23 deletions
+27
-23
src/main/resources/application-dev.yml
+9
-7
src/main/resources/application-pro.yml
+9
-8
src/main/resources/application-test.yml
+9
-8
No files found.
src/main/resources/application-dev.yml
View file @
14f868f1
...
...
@@ -36,27 +36,29 @@ spring:
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name
:
com.mysql.cj.jdbc.Driver
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initial-size
:
5
min-idle
:
5
max-active
:
20
max-active
:
50
maximum-pool-size
:
80
max-wait
:
60000
# 配置获取连接等待超时的时间
time-between-eviction-runs-millis
:
6
0000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis
:
3
00000
# 配置一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis
:
30
0000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis
:
18
00000
# 配置一个连接在池中最小生存的时间,单位是毫秒
validation-query
:
SELECT 1 FROM DUAL
test-while-idle
:
true
# 当连接空闲时,是否执行连接测试
test-on-borrow
:
false
# 当从连接池借用连接时,是否测试该连接
test-on-return
:
false
# 在连接归还到连接池时是否测试该连接
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements
:
true
max-pool-prepared-statement-per-connection-size
:
20
# 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true。在Druid中,不会存在Oracle下PSCache占用内存过多的问题,可以把这个数值配置大一些,比如说100
#max-pool-prepared-statement-per-connection-size: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters
:
stat,slf4j
use-global-data-source-stat
:
true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
druid
:
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters
:
stat,slf4j
# 配置监控服务器
stat-view-servlet
:
login-username
:
Tang
...
...
src/main/resources/application-pro.yml
View file @
14f868f1
...
...
@@ -36,27 +36,28 @@ spring:
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name
:
com.mysql.cj.jdbc.Driver
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initial-size
:
5
min-idle
:
5
max-active
:
20
max-active
:
50
maximum-pool-size
:
80
max-wait
:
60000
# 配置获取连接等待超时的时间
time-between-eviction-runs-millis
:
6
0000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis
:
3
00000
# 配置一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis
:
30
0000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis
:
18
00000
# 配置一个连接在池中最小生存的时间,单位是毫秒
validation-query
:
SELECT 1 FROM DUAL
test-while-idle
:
true
# 当连接空闲时,是否执行连接测试
test-on-borrow
:
false
# 当从连接池借用连接时,是否测试该连接
test-on-return
:
false
# 在连接归还到连接池时是否测试该连接
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements
:
true
max-pool-prepared-statement-per-connection-size
:
20
# 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true。在Druid中,不会存在Oracle下PSCache占用内存过多的问题,可以把这个数值配置大一些,比如说100
#max-pool-prepared-statement-per-connection-size: 20
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
druid
:
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters
:
stat,slf4j
use-global-data-source-stat
:
true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 配置监控服务器
stat-view-servlet
:
login-username
:
Tang
...
...
src/main/resources/application-test.yml
View file @
14f868f1
...
...
@@ -36,27 +36,28 @@ spring:
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name
:
com.mysql.cj.jdbc.Driver
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initial-size
:
5
min-idle
:
5
max-active
:
20
max-active
:
50
maximum-pool-size
:
80
max-wait
:
60000
# 配置获取连接等待超时的时间
time-between-eviction-runs-millis
:
6
0000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis
:
3
00000
# 配置一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis
:
30
0000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis
:
18
00000
# 配置一个连接在池中最小生存的时间,单位是毫秒
validation-query
:
SELECT 1 FROM DUAL
test-while-idle
:
true
# 当连接空闲时,是否执行连接测试
test-on-borrow
:
false
# 当从连接池借用连接时,是否测试该连接
test-on-return
:
false
# 在连接归还到连接池时是否测试该连接
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements
:
true
max-pool-prepared-statement-per-connection-size
:
20
# 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true。在Druid中,不会存在Oracle下PSCache占用内存过多的问题,可以把这个数值配置大一些,比如说100
#max-pool-prepared-statement-per-connection-size: 20
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
druid
:
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters
:
stat,slf4j
use-global-data-source-stat
:
true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 配置监控服务器
stat-view-servlet
:
login-username
:
Tang
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment