最近在一个项目中使用Redis保存Token时,出现连接Redis报错的情况,被折磨了一晚上。。Unable to connect to localhost:6379 1.检查Redis配置信息 redis: host: xx.xx.xx.xx port: 6379 connect-timeout: 5000 2.进入redis.conf把bin:127.0.0.1用#注释掉,修改protected-mode配置的值为no 3.看看防火墙是否关闭,我最后是把防火墙关掉成功的。