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
有錯的地方,歡迎大家更正,博客小白,請多多關照...