SpringBoot配置信息参考大全

SpringBoot常用配置信息
官方参考地址:https://docs.spring.io/spring-boot/docs/2.1.0.BUILD-SNAPSHOT/reference/htmlsingle/#common-application-properties

#服务启动的端口号(用Tomcat运行时无效)
server.port=8080
#项目的部署名称(用Tomcat运行时无效)
server.context-path=/SZAirPomDataSynch

<!-------------------------数据库相关信息-------------------------------------------------------------->

#数据库配置信息
spring.datasource.driver-class-name =com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/studypay?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=liuhong
spring.datasource.password=liuhong987
spring.datasource.initialSize=30
spring.datasource.minIdle=15
spring.datasource.maxActive=100
spring.datasource.minPoolSize=30
spring.datasource.maxWait=60000000

#如果不使用默认的数据库连接池 (com.zaxxer.hikari.HikariDataSource)
spring.datasource.type =com.alibaba.druid.pool.DruidDataSource

#配置druid连接池时用一下配置
spring.datasource.druid.initial-size=10
spring.datasource.druid.max-active=50
spring.datasource.druid.min-idle=5
spring.datasource.druid.max-wait=60000


#mybatis 下划线转驼峰配置,两者都可以(在执行查询时将查询结果自动转换成对象)
#mybatis.configuration.mapUnderscoreToCamelCase=true
mybatis.configuration.map-underscore-to-camel-case=true

#xml文件存放位置
mybatis.mapper-locations=classpath*:mapper/*.xml
#xml对应接口所在包名
mybatis.type-aliases-package=com.roadtel.dao
#打印sql,方便调试
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

<!-------------------------数据库相关信息-------------------------------------------------------------->

#pagehelper分页插件使用的配置
pagehelper.helperDialect=mysql
pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql

<!-------------------------Redis的相关配置--------------------------------------------------------------->

#Redis的主机名
spring.redis.host=1ocalhost
# 连接URL,将覆盖主机,端口和密码(用户将被忽略),例如:redis://user:password@example.com:6379
spring.redis.url=redis://user:password@example.com:6379
# 使用的数据库(0-15),默认为0
spring.redis.database=0
spring.redis.password=
#redis的端口号
spring.redis.port=6379 
spring.redis.ssl=false
#Redis连接超时
spring.redis.timeout=30000 
spring.redis.jedis.pool.max-active=80
spring.redis.jedis.pool.max-idle=50
spring.redis.jedis.pool.max-wait=-1ms
spring.redis.jedis.pool.min-idle=0

#集群最大重定向数量
spring.redis.cluster.max-redirects=15
#Redis集群的服务器及端口号,用逗号隔开
spring.redis.cluster.nodes=127.0.0.1:6379,127.0.0.1:6380

# 哨兵监听的Redis server的名称
spring.redis.sentinel.master=mymaster
#哨兵的配置列表
spring.redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26479,127.0.0.1:26579

<!-------------------------Redis的相关配置--------------------------------------------------------------->

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值