Browse Source

修改yml

lwx_dev
erdanergou 2 years ago
parent
commit
0fa5700b33
  1. 11
      pom.xml
  2. 4
      src/main/java/com/dreamchaser/depository_manage/DepositoryManageApplication.java
  3. 89
      src/main/resources/application-prod.yml
  4. 90
      src/main/resources/application-test.yml

11
pom.xml

@ -54,6 +54,13 @@
<version>3.2.0</version> <version>3.2.0</version>
</dependency> </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
@ -65,8 +72,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid</artifactId> <artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.14</version> <version>1.2.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>

4
src/main/java/com/dreamchaser/depository_manage/DepositoryManageApplication.java

@ -1,11 +1,13 @@
package com.dreamchaser.depository_manage; package com.dreamchaser.depository_manage;
import com.alibaba.druid.pool.xa.DruidXADataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication @SpringBootApplication(exclude = DruidDataSourceAutoConfigure.class)
public class DepositoryManageApplication extends SpringBootServletInitializer { public class DepositoryManageApplication extends SpringBootServletInitializer {
public static void main(String[] args) { public static void main(String[] args) {

89
src/main/resources/application-prod.yml

@ -1,13 +1,13 @@
#开启健康检查、审计、统计和监控,即可通过访问/actuator/beans等查看状态 #开启健康检查、审计、统计和监控,即可通过访问/actuator/beans等查看状态
management: management:
endpoints: endpoints:
web: web:
exposure: exposure:
include: beans,health include: beans,health
spring: spring:
mobile: mobile:
sitepreference: sitepreference:
enabled:true enabled: true
servlet: servlet:
multipart: multipart:
@ -16,41 +16,46 @@ spring:
max-request-size: 100MB # 一次请求总大小上限 max-request-size: 100MB # 一次请求总大小上限
##数据库设置 ##数据库设置
datasource: datasource:
dynamic: dynamic:
druid: strict: false
initialSize: 5 # 初始连接数 primary: master # 配置默认数据库
minIdle: 5 # 最小空闲数 datasource:
maxActive: 20 #最大活跃连接数 master:
maxWait: 60000 #获取连接的最大等待时间(毫秒) username: depository # 用户名
timeBetweenEvictionRunsMillis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 password: NhE47edekBHxhjYk #密码
minEvictableIdleTimeMillis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒 url: jdbc:mysql://127.0.0.1:3306/depository?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8
useGlobalDataSourceStat: true driver-class-name: com.mysql.cj.jdbc.Driver #驱动
testWhileIdle: true type: com.alibaba.druid.pool.DruidDataSource
testOnReturn: false
testOnBorrow: false hr_new:
poolPreparedStatements: true username: hr_new
maxPoolPreparedStatementPerConnectionSize: 20 password: AnknKiXiXaxNrw78
#配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙 url: jdbc:mysql://127.0.0.1:3306/hr_new?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8
filters: stat, wall, log4j driver-class-name: com.mysql.cj.jdbc.Driver
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 type: com.alibaba.druid.pool.DruidDataSource
#超时回收机制 druid:
removeAbandoned: true initialSize: 5 # 初始连接数
removeAbandonedTimeout: 1800 minIdle: 5 # 最小空闲数
logAbandoned: true maxActive: 20 #最大活跃连接数
datasource: maxWait: 60000 #获取连接的最大等待时间(毫秒)
master: timeBetweenEvictionRunsMillis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
username: depository # 用户名 minEvictableIdleTimeMillis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
password: NhE47edekBHxhjYk #密码 useGlobalDataSourceStat: true
url: jdbc:mysql://127.0.0.1:3306/depository?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8 testWhileIdle: true
driver-class-name: com.mysql.cj.jdbc.Driver #driver testOnReturn: false
type: com.alibaba.druid.pool.DruidDataSource testOnBorrow: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
#配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
filters: stat, wall, log4j
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#超时回收机制
removeAbandoned: true
removeAbandonedTimeout: 1800
logAbandoned: true
hr_new:
username: hr_new
password: AnknKiXiXaxNrw78
url: jdbc:mysql://127.0.0.1:3306/hr_new?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
banner: banner:
location: banner.txt location: banner.txt
@ -77,20 +82,12 @@ spring:
max-active: 200 max-active: 200
timeout: 2000ms timeout: 2000ms
redisPool: redisPool:
port: 6379 port: 6379
host: 127.0.0.1 host: 127.0.0.1
dbs: 5,14,15 dbs: 5,14,15
password: password:
server:
mybatis:
type-aliases-package: com.dreamchaser.depository_manage.entity
configuration:
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
log-prefix: mapper.
mybatis-plus: mybatis-plus:
mapper-locations: classpath*:*_mapper/*Mapper.xml mapper-locations: classpath*:*_mapper/*Mapper.xml

90
src/main/resources/application-test.yml

@ -1,9 +1,9 @@
#开启健康检查、审计、统计和监控,即可通过访问/actuator/beans等查看状态 #开启健康检查、审计、统计和监控,即可通过访问/actuator/beans等查看状态
management: management:
endpoints: endpoints:
web: web:
exposure: exposure:
include: beans,health include: beans,health
spring: spring:
mobile: mobile:
sitepreference: sitepreference:
@ -16,42 +16,46 @@ spring:
max-request-size: 100MB # 一次请求总大小上限 max-request-size: 100MB # 一次请求总大小上限
##数据库设置 ##数据库设置
datasource: datasource:
dynamic: dynamic:
datasource: strict: false
master: primary: master # 配置默认数据库
username: root datasource:
password: root master:
url: jdbc:mysql://127.0.0.1:3306/depository?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8 username: root # 用户名
driver-class-name: com.mysql.cj.jdbc.Driver password: root #密码
type: com.alibaba.druid.pool.DruidDataSource url: jdbc:mysql://127.0.0.1:3306/depository?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8
initialSize: 5 driver-class-name: com.mysql.cj.jdbc.Driver #驱动
minIdle: 5 type: com.alibaba.druid.pool.DruidDataSource
maxActive: 10
maxWait: 60000 hr_new:
timeBetweenEvictionRunsMillis: 60000 username: hr_new
minEvictableIdleTimeMillis: 300000 password: AnknKiXiXaxNrw78
validationQuery: SELECT 1 FROM DUAL url: jdbc:mysql://172.20.2.87:3306/hr_new?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8
useGlobalDataSourceStat: true driver-class-name: com.mysql.cj.jdbc.Driver
server: type: com.alibaba.druid.pool.DruidDataSource
port: 9090 druid:
testWhileIdle: true initialSize: 5 # 初始连接数
testOnReturn: false minIdle: 5 # 最小空闲数
testOnBorrow: false maxActive: 20 #最大活跃连接数
poolPreparedStatements: true maxWait: 60000 #获取连接的最大等待时间(毫秒)
maxPoolPreparedStatementPerConnectionSize: 20 timeBetweenEvictionRunsMillis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
#配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙 minEvictableIdleTimeMillis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
filters: stat, wall, log4j useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 testWhileIdle: true
#超时回收机制 testOnReturn: false
removeAbandoned: true testOnBorrow: false
removeAbandonedTimeout: 1800 poolPreparedStatements: true
logAbandoned: true maxPoolPreparedStatementPerConnectionSize: 20
hr_new: #配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
username: hr_new filters: stat, wall, log4j
password: AnknKiXiXaxNrw78 connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
url: jdbc:mysql://172.20.2.87:3306/hr_new?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8 #超时回收机制
driver-class-name: com.mysql.cj.jdbc.Driver removeAbandoned: true
type: com.alibaba.druid.pool.DruidDataSource removeAbandonedTimeout: 1800
logAbandoned: true
banner: banner:
location: banner.txt location: banner.txt
@ -78,20 +82,12 @@ spring:
max-active: 200 max-active: 200
timeout: 2000ms timeout: 2000ms
redisPool: redisPool:
port: 6379 port: 6379
host: 127.0.0.1 host: 127.0.0.1
dbs: 5,14,15 dbs: 5,14,15
password: password:
server:
mybatis:
type-aliases-package: com.dreamchaser.depository_manage.entity
configuration:
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
log-prefix: mapper.
mybatis-plus: mybatis-plus:
configuration: configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

Loading…
Cancel
Save