Spring Boot的yml配置
#开发配置
spring:
data:
solr:
host: http://localhost:6789/solr/mote
mvc:
view:
# 页面默认前缀目录
prefix: /WEB-INF/jsp/
# 响应页面默认后缀
suffix: .jsp
rabbitmq:
port: 5672
host: 127.0.0.1
username: hao
password: hao
virtual-host: /jiga
profiles:
active: dev
datasource:
# 使用druid数据源 url: jdbc:mysql://ip地址:3306/epos?serverTimezone=GMT%2B8 username: root type: com.alibaba.druid.pool.DruidDataSource #这里放的是生成加密后的password password: OLeegOuseeGWH6oLeZ5vOknGMcp3uA9pmfgW9W/OL14mriIVW8RCPQ67ypLNeJnrPs7YAAlfCwoeFJFSuhllzA== driver-class-name: com.mysql.jdbc.Driver druid: #用于采集web-jdbc关联监控的数据 web-stat-filter: #添加过滤规则 url-pattern: '/*' #排除一些不必要的url exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' enabled: true #配置profileEnable能够监控单个url调用的sql列表 profile-enable: true #session统计功能 session-stat-enable: true #session-stat-max-count: 2 stat-view-servlet: enabled: true url-pattern: /druid/* #是否可以重置统计页面 reset-enable: true #控制台管理用户 login-username: root login-password: 123 aop-patterns: com.example.demo.cn.service.* #最大连接池数量 max-active: 10 #最小连接池数量 min-idle: 1 initial-size: 1 max-wait: 60000 #销毁线程中如果检测到当前连接的最后活跃时间和当前时间的差值大于minEvictableIdleTimeMillis,则关闭当前连接。 minEvictableIdleTimeMillis: 300000 #用来检测连接是否有效的sql,要求是一个查询语句。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会其作用 validationQuery: select 'x' #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 timeBetweenEvictionRunsMillis: 60000 #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于 timeBetweenEvictionRunsMillis, #执行validationQuery检测连接是否有效。 testWhileIdle: true #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 testOnBorrow: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能 testOnReturn: false #是否缓存preparedStatement,也就是PSCache。 poolPreparedStatements: true #要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true。 maxOpenPreparedStatements: 100 connection-properties: "config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAI0/5xoPD11/XeqtJef25bnsMwxfxbRC6x+j4rInDKYLzajTu5wkd/5+fl5bMAfhB37n4hoAvqQpz3mFSkOc9ZMCAwEAAQ==" filters: stat,wall,log4j,config tomcat: #对于长时间不使用的连接强制关闭 remove-abandoned: true #超过30分钟开始关闭空闲连接3- remove-abandoned-timeout: 1800 #将当前关闭动作记录到日志 log-abandoned: true # jpa: # hibernate: # ddl-auto: update # 第一次简表create 后面用update # show-sql: true #mybatis mybatis: type-aliases-package: classpath:com.spring.boot.solr.cn.pojo mapper-locations: classpath:com/spring/boot/solr/cn/dao/mapper/*.xml #分页 #pagehelper: # helperDialect: mysql # reasonable: true # supportMethodsArguments: true # params: count=countSql redis: #数据库索引 database: 0 host: 127.0.0.1 port: 6379 logging: file: login/orcale.log
有错的地方,欢迎大家更正,博客小白,请多多关照...
SpringBoot的yml配置
猜你喜欢
转载自www.cnblogs.com/mzy520/p/10109348.html
今日推荐
周排行