server: port: 8081 spring: application: name: timetable datasource: #数据源配置 username: root password: root url: jdbc:mysql://127.0.0.1/sjsj?serverTimezone=GMT%2B8 #8.0 上的驱动包 driver-class-name: com.mysql.cj.jdbc.Driver # 指定数据源类型 type: com.alibaba.druid.pool.DruidDataSource # 配置数据druid源 # 数据源其他配置, DataSourceProperties中没有相关属性,默认无法绑定 initialSize: 8 minIdle: 5 maxActive: 20 maxWait: 60000 timeBetweenEvictionRunsMillis: 60000 minEvictableIdleTimeMillis: 300000 validationQuery: SELECT 1 FROM DUAL testWhileIdle: true testOnBorrow: false testOnReturn: false poolPreparedStatements: true # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 filters: stat,wall,slf4j #slf4j logback maxPoolPreparedStatementPerConnectionSize: 25 useGlobalDataSourceStat: true connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500 # mybatis-plus 配置 #mybatis-plus: # type-aliases-package: com.wdt.cloud.entity # mapper-locations: classpath:mapper/*.xml # 日志级别,会打印sql语句 logging: level: com.wdt.cloud.mapper: debug # 开启springmvc hidden 控制器 支持DeleteMapping 支持web中put提交方式 mvc: hiddenmethod: filter: enabled: true eureka: client: registerWithEureka: true # 服务注册开关 fetchRegistry: true # 服务发现开关 serviceUrl: # 注册到哪一个Eureka Server服务注册中心,多个中间用逗号分隔 #defaultZone: http://localhost:6001/eureka defaultZone: http://localhost:6001/eureka,http://localhost:6002/eureka instance: instanceId: ${spring.application.name}:${server.port} # 等价于microservice-product:8001 prefer-ip-address: true #访问路径就会显示成IP地址
springboot yml druid+eureka 基本配置
最新推荐文章于 2023-08-20 16:04:59 发布