centos7下安装与初始化
- yum install redis
- service redis start 启动redis
- systemctl enable redis 设置为开机自启动
- 设置redis 远程连接和密码
- 将下面的绑定注释掉
#bind 127.0.0.1
- 保护模式修改为no
protected-mode no
- 重启redis service redis restart
springboot使用
maven依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
配置
使用
- 插入
- 读取