redis配置 ,properties文件

spring.redis.hostName: 192.168.174.128
spring.redis.port: 6379
spring.redis.password: xuan123456
spring.redis.database: 2 #默认使用db0
spring.redis.timeout: 0
spring.redis.pool.max-active: 8
spring.redis.pool.max-wait: -1
spring.redis.pool.max-idle: 8
spring.redis.pool.min-idle: 0

redis 配置,yml文件

spring:
redis:
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
database: 3
# redis服务器地址(默认为localhost)
host: localhost
# redis端口(默认为6379)
port: 6379
# redis访问密码(默认为空)
password:
# redis连接超时时间(单位为毫秒)
timeout: 0
# redis连接池配置
pool:
# 最大可用连接数(默认为8,负数表示无限)
max-active: 8
# 最大空闲连接数(默认为8,负数表示无限)
max-idle: 8
# 最小空闲连接数(默认为0,该值只有为正数才有作用)
min-idle: 0
# 从连接池中获取连接最大等待时间(默认为-1,单位为毫秒,负数表示无限)
max-wait: -1

参考微博

spring-boot 融合redis mybatis
<https://juejin.im/post/592c08292f301e006c60cae2#heading-9>

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信