官网下载 .zip
解压到指定文件下
主从设置,所以将解压的文件复制三份
解压后文件
红色标的是创建window启动文件,好像不行,不知道什么问题.大神可以指教下。
6379作为主节点,redis.windows.cof 配置不需要改
6380作为从节点,redis.windows.cof 配置改
从节点端口号
放开slaveof
6381作为从节点,redis.windows.cof 同上
6382作为从节点,redis.windows.cof 同上
redis主从完事了,管理员启动cmd进入redis所在路径下
redis-server.exe redis.windows.conf
如下图
打开新的cmd
另外打开cmd
springboot + maven 项目中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--spring session 与redis应用基本环境配置 -->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
测试