Backgroud:
I’ve learned redis since last Friday, it’s worthy to have a summary for the process.
-
Redis’ Web:
redis.io -
Installation on Linux&Config Setting:
在Linux上安装redis和配置 -
Installation on new Mac by using brew:
在MacOS上安装redis -
Command Guides:
redis指令汇总 -
Dependences for reference
<!-- This dependency includes commoms-pool2:2.11.1,so we dont need to add antoher pool2 dependence -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.3.0</version>
</dependency>
<!-- Another client -->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.10.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
- properties.yml for reference
spring:
redis:
host: 127.0.0.1
password: ****
port: 6379
jedis:
pool:
enabled: true
max-active: 8 #最大连接
max-wait: 1000ms #连接等待时间
max-idle: 8 #最大空闲连接
min-idle: 0 #最小空闲连接
PS:Here I prefer Jedis as redis pool, the default pool enbeded in Spring Boot currently is lettuce.