springboot一键application.yml配置文件

server :
  port : 8080
  ##项目名字配置
  #servlet :
  #  context-path : /demo
  tomcat :
    uri-encoding : UTF-8
    #xx 报错修改的地方
    max-connections: 200000
    max-http-form-post-size: 9000000
    threads:
      max: 128
      min-spare: 5
spring :
  # 环境 dev|test|prod
  profiles :
    active : dev
    #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
    #include: ftpHX,ftpCloud
  servlet:
    multipart:
      #设置总上传的数据大小
      max-request-size: 100MB
      #单个文件大小
      maxFileSize : 30MB
        #xx 报错修改的地方
    max-connections: 200000
    max-http-post-size: 9000000
  #热部署模块
  devtools:
    restart:
      #热部署开关
      enabled: true
      #指定热部署的目录
      additional-paths: src/main/java
      #指定目录不更新
      exclude: test/**
  mvc:   #静态文件
    static-path-pattern : /static/**
    pathmatch:
      matching-strategy: ant_path_matcher
  #模板引擎
  thymeleaf:
    model: HTML5
    prefix: classpath:/templates/
    suffix: .html
    #指定编码
    encoding: utf-8
    #禁用缓存 默认false
    cache: false
  jackson:
    time-zone: GMT+8
    date-format: yyyy-MM-dd HH:mm:ss
  redis:
    ssl: false
    database: 0
    host: 127.0.0.1
    port: 6379
    password: 
    timeout: 1000
    lettuce:
      pool:
        max-active: 200
        max-wait: -1
        max-idle: 10
        min-idle: 0
#mybatis:
#  #配置mapper的扫描,找到所有的mapper.xml映射文件
#  mapperLocations : classpath*:mybatis/*/*.xml
#  #mybatis提供三种sql执行器,分别是SIMPLE、REUSE、BATCH。
#  executor-type : reuse
#  #搜索指定包别名
#  typeAliasesPackage : com.*.model
#  #该配置项就是指将带有下划线的表字段映射为驼峰格式的实体类属性。
#  configuration :
#    map-underscore-to-camel-case : true


# 控制台输出sql、下划线转驼峰
mybatis-plus:
  mapper-locations: classpath:/mybatis-plus/*.xml
  typeAliasesPackage: com.fc.pilotSchool.model
  # 控制台输出sql、下划线转驼峰
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    map-underscore-to-camel-case: true

#pagehelper分页插件
pagehelper:
    helperDialect: mysql
    reasonable: true
    supportMethodsArguments: true
    params: count=countSql
oss:
  enable: true
  info: true
  path-style-access: false  #使用云OSS 需要关闭
  endpoint: http://127.0.0.1:9000 #对应上图 ③ 处配置
  access-key: minioadmin  # 上文创建的AK
  secret-key: minioadmin # 上文创建的SK
  bucket-name: v2-cloud  # 上文创建的桶名称

application-dev.yml文件

#dev环境  mysql7.0
spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    #druid连接池配置
    druid:
     #主库数据源
     master:
        url: jdbc:mysql://xxx.xxx.xxx.xxx:3306/xxxx?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT
        username: xxxxx
        password: xxxxx
     #备数据源 #关闭
     slave:
        enabled: false
        url: jdbc:mysql://localhost:3306/xxxx?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
        username: xxxx
        password: xxxx
        #配置初始化连接数大小
     initial-size: 10
     # 最大连接数
     maxActive: 50
     #最小连接数
     minIdle: 10
     #获取连接等待超时时间
     maxWait: 5000
     poolPreparedStatements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
     maxPoolPreparedStatementPerConnection-size: 20
     validationQuery: SELECT 1 FROM DUAL
     validationQueryTimeout: 20000
     testOnBorrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
     testOnReturn: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
     testWhileIdle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
     timeBetweenEvictionRunsMillis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
     minEvictableIdleTimeMillis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
     maxEvictableIdleTimeMillis: 900000  # 配置一个连接在池中最大生存的时间,单位是毫秒
     #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
     webStatFilter:
      enabled: true
     statViewServlet:
      enabled: true
      urlPattern: /druid/*
      #可以增加访问账号密码【去掉注释就可以】
      #login-username: admin
      #login-password: admin
     filter:
      stat:
        enabled: true
        # 慢SQL记录
        log-slow-sql: true
        slow-sql-millis: 1000
        merge-sql: true
      wall:
        config:
          multi-statement-allow: true

#mysql 8.0

#spring:
#  datasource:
#    type: com.alibaba.druid.pool.DruidDataSource
#    driverClassName: com.mysql.cj.jdbc.Driver
#    #druid连接池配置
#    druid:
#     # 主库数据源
#     master:
#        url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
#        username: root
#        password: root
#        #树熊数据源
#     slave:
#        enabled : false
#        url: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
#        username: root
#        password: root
#        #配置初始化连接数大小
#     initial-size: 10
#     # 最大连接数
#     max-active: 50
#     #最小连接数
#     min-idle: 10
#     #获取连接等待超时时间
#     max-wait: 5000
#     pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
#     max-pool-prepared-statement-per-connection-size: 20
#     validation-query: SELECT 1 FROM DUAL
#     validation-query-timeout: 20000
#     test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
#     test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
#     test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
#     time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
#     min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
#     #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
#     stat-view-servlet:
#      enabled: true
#      url-pattern: /druid/*
#      #可以增加访问账号密码【去掉注释就可以】
#      #login-username: admin
#      #login-password: admin
#     filter:
#      stat:
#        log-slow-sql: true
#        slow-sql-millis: 1000
#        merge-sql: true
#      wall:
#        config:
#          multi-statement-allow: true
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值