redis的主要作用是用来做缓存,具体来说,我在项目中的作用是用来做token的验证。快速存取用的.
文章目录
#配置redis
##mac安装redis
###安装
brew install redis
###配置
vim /usr/local/etc/redis.conf
修改下面这行,把redis配置成守护进程
daemonize yes -> daemonize no
###检测
ps -ef |grep redis
###启动
sudo redis-server /usr/local/etc/redis.conf
###连接到命令行模式
redis-cli
##配置jpa的application.properties
(设置了密码加上password=“xxx”)
spring.redis.host=localhost
spring.redis.port=6379
#最大分配的对象数
spring.redis.Pool.maxIdle=10
spring.redis.Pool.maxActive=10
博主开发的第三方CSDN客户端.体验很棒哦,快来体验下载吧