搜索

Could not connect to Redis at 127.0.0.1:6379: Connection refused


发布时间: 2022-11-24 23:13:00    浏览次数:137 次
[root@centoszang 桌面]# redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected> exit
[root@centoszang 桌面]# redis-server /etc/redis.conf
[root@centoszang 桌面]# redis-cli
127.0.0.1:6379> 

在使用Redis时,开始就遇到了问题,客户端打不开,原因是需要先开启服务端,这需要先配置——

1.下载好redis安装包,解压安装之后,复制其配置文件redis.conf 到etc 文件夹下

  cd /opt/redis-3.2.8

  cp redis.conf /etc

\2. 进入etc,找到redis.conf 并修改 daemonize no(第128行) 为 daemonize yes ,这样就可以默认启动就后台运行

\3. 开启客户端要确保服务端启动

  redis-server /etc/redis.conf

4.启动客户端不成功要退出再进行下一步

img

免责声明 Could not connect to Redis at 127.0.0.1:6379: Connection refused,资源类别:文本, 浏览次数:137 次, 文件大小:-- , 由本站蜘蛛搜索收录2022-11-24 11:13:00。此页面由程序自动采集,只作交流和学习使用,本站不储存任何资源文件,如有侵权内容请联系我们举报删除, 感谢您对本站的支持。 原文链接:https://www.cnblogs.com/javaxubo/p/16916538.html