admin管理员组

文章数量:1608629

问题1:今天使用Spring Boot整合Redis时一直连不上,console错误信息:Unable to connect to Redis;java.ConnectException: Connection refused: no further information
尝试下面几个不中解决

1、关闭防火墙 chkconfig iptables off
找到redis安装目录中bin目录下的配置文件redis.conf
修改bind配置: bind 192.168.51.135 127.0.0.1 (192.168.51.135是对外暴露的IP)
修改 protected-mode yes 改为:protected-mode no
重启redis服务:./redis-server redis.conf

问题2:在service层的方法上使用@Cacheable属性,测试数据没有进入redis,每次查询都会查询数据库
在启动类Application.java上增加@EnableCaching

本文标签: 两个SpringbootRedis