Redis 安装
1、从Redis官网下载源码 http://www.redis.io;

2、解压,并进入相应目录
3、编译、安装
sudo make install
出现下图说明安装成功了!!!

4、测试编译安装
sudo make test
5、启动服务
./src/redis-server or ./src/redis-server &

6、启动client,验证安装服务
./src/redis-cli

idea+spring 使用redis
1、pom.xml 配置 redis
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>RELEASE</version>
</dependency>
2、application.yml 配置IP、port信息
spring:
redis:
host: 127.0.0.1
port: 6379
3、使用 redis
-
引入包: import org.springframework.data.redis.core.*;
网友评论