1、pom.xml配置
<!--redis--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!--lettuce pool 缓存连接池 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency>
2、 application.yml配置
spring: redis: host: 192.168.11.10 port: 6379 password: 123456 ssl: false database: 0 timeout: 30s # jedis: # pool: # max-active: 8 #缺省值8 # max-idle: 8 #缺省值8 # min-idle: 0 #缺省值0 # max-wait: 30s #缺省值-1 #基于netty nio lettuce: pool: max-active: 8 #缺省值8 max-idle: 8 #缺省值8 min-idle: 0 #缺省值0 max-wait: 30s #缺省值-1
Copyright © 叮叮声的奶酪 版权所有
备案号:鄂ICP备17018671号-1