解决 redis 无法远程连接


Posted in Redis onMay 15, 2022

问题描述:

redis远程服务端运行在192.168.3.90计算机上,客户端计算机(ip:192.168.3.110)通过redsi-cli.exe客户端工具连接时,没有反应,连接不上。

如图所示:

解决 redis 无法远程连接

解决步骤:

步骤一:注释掉redis.window.conf文件中的bind属性设置。

如图所示:

解决 redis 无法远程连接

解决 redis 无法远程连接

步骤二:把protected-mode属性设置no

解决 redis 无法远程连接

重启redis即可远程连接。

如图所示:

解决 redis 无法远程连接

解决 redis 无法远程连接

解决 redis 无法远程连接

确定启动成功,查看所有keys

解决 redis 无法远程连接

清空所有keys

解决 redis 无法远程连接

注意事项:

不能直接双击redis安装目录下bin目录下的redis-server.exe启动redis服务端,否则会导致无法通过远程客户端进行操作。

如果所示,通过双击redis-server.exe命令启动redis后,然后执行keys查看所有键时报错,

解决 redis 无法远程连接

解决 redis 无法远程连接

解决 redis 无法远程连接

报错如下异常:

(error) DENIED Redis is running in protected mode because protected mode is enabled, 
no bind address was specified, no authentication password is requested to clients. 
In this mode connections are only accepted from the loopback interface. 
If you want to connect from external computers to Redis you may adopt one of the following solutions:
1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis 
from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. 
Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file,
and setting the protected mode option to 'no', and then restarting the server. 
3) If you started the server manually just for testing, restart it with the '--protected-mode no' option.
4) Setup a bind address or an authentication password. 
NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

原因分析:从启动成功界面分析,这种方式的启动读取的配置文件可能不是redis.windows.conf文件,故之前设置的内容没有生效。

所以启动redis时,通过进入redis安装目录下的bin目录,然后执行

redis-server redis.windows.conf

命令启动名。

另外redis-cli客户端连接redis服务端命令如下

redis-cli -h 192.168.3.90 -p 6379
  • -h 选择指定服务端ip
  • -p 选择指定端口。

到此这篇关于redis远程连接不上的解决办法的文章就介绍到这了,更多相关redis远程连接不上内容请搜索三水点靠木以前的文章或继续浏览下面的相关文章希望大家以后多多支持三水点靠木!


Tags in this post...

Redis 相关文章推荐
Windows下redis下载、redis安装及使用教程
Jun 02 Redis
Windows中Redis安装配置流程并实现远程访问功能
Jun 07 Redis
浅谈Redis中的RDB快照
Jun 29 Redis
redis不能访问本机真实ip地址的解决方案
Jul 07 Redis
基于Redis结合SpringBoot的秒杀案例详解
Oct 05 Redis
详解redis在微服务领域的贡献
Oct 16 Redis
解决Redis启动警告问题
Feb 24 Redis
面试分析分布式架构Redis热点key大Value解决方案
Mar 13 Redis
Redis调用Lua脚本及使用场景快速掌握
Mar 16 Redis
redis击穿 雪崩 穿透超详细解决方案梳理
Mar 17 Redis
redis数据结构之压缩列表
Mar 21 Redis
浅谈Redis变慢的原因及排查方法
Jun 21 Redis
Redis 限流器
May 15 #Redis
Redis高并发缓存架构性能优化
详解Redis的三种常用的缓存读写策略步骤
windows安装 redis 6.2.6最新步骤详解
muduo TcpServer模块源码分析
Redis数据同步之redis shake的实现方法
Apr 21 #Redis
Grafana可视化监控系统结合SpringBoot使用
You might like
如何从一个php文件向另一个地址post数据,不用表单和隐藏的变量的
2007/03/06 PHP
php实现12306火车票余票查询和价格查询(12306火车票查询)
2014/01/14 PHP
php 从一个数组中随机的取出若干个不同的数实例
2016/12/31 PHP
基于PHP实现的多元线性回归模拟曲线算法
2018/01/30 PHP
PHP实现多图上传和单图上传功能
2018/05/17 PHP
PHP压缩图片功能的介绍
2019/03/21 PHP
详细讲解JS节点知识
2010/01/31 Javascript
jQuery 性能优化手册 推荐
2010/02/23 Javascript
js 创建书签小工具之理论
2011/02/25 Javascript
顶部缓冲下拉菜单导航特效的JS代码
2013/08/27 Javascript
seajs中模块的解析规则详解和模块使用总结
2014/03/12 Javascript
jquery插件orbit.js实现图片折叠轮换特效
2015/04/14 Javascript
jQuery固定元素插件scrolltofixed使用指南
2015/04/21 Javascript
javascript解三阶幻方(九宫格)
2015/04/22 Javascript
jQuery实现的动态伸缩导航菜单实例
2015/05/07 Javascript
js实现tab切换效果实例
2015/09/16 Javascript
JavaScript判断手机号运营商是移动、联通、电信还是其他(代码简单)
2015/09/25 Javascript
ionic隐藏tabs的方法
2016/08/29 Javascript
jQuery旋转插件jqueryrotate用法详解
2016/10/13 Javascript
jQuery Validate 相关参数及常用的自定义验证规则
2017/03/06 Javascript
Angular4 ElementRef的应用
2018/02/26 Javascript
vue实现侧边栏导航效果
2019/10/21 Javascript
JS图片懒加载技术实现过程解析
2020/07/27 Javascript
在Django框架中编写Contact表单的教程
2015/07/17 Python
python 图像处理画一个正弦函数代码实例
2019/09/10 Python
numpy.ndarray 实现对特定行或列取值
2019/12/05 Python
Python中return函数返回值实例用法
2020/11/19 Python
三星俄罗斯授权在线商店:Samsung俄罗斯
2019/09/28 全球购物
中学生学习生活的自我评价
2013/10/26 职场文书
学校安全工作制度
2014/01/19 职场文书
乱丢垃圾袋检讨书
2014/10/08 职场文书
2014年纪检部工作总结
2014/11/12 职场文书
小学教师教学随笔
2015/08/14 职场文书
pandas 实现将NaN转换为None
2021/05/14 Python
PHP中多字节字符串操作实例详解
2021/08/23 PHP
MySQL事务的ACID特性以及并发问题方案
2022/07/15 MySQL