解决 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 相关文章推荐
详解Redis主从复制实践
May 19 Redis
详解缓存穿透击穿雪崩解决方案
May 28 Redis
了解Redis常见应用场景
Jun 23 Redis
浅析Redis Sentinel 与 Redis Cluster
Jun 24 Redis
Redis做数据持久化的解决方案及底层原理
Jul 15 Redis
Redis Cluster 集群搭建你会吗
Aug 04 Redis
Redis分布式锁Redlock的实现
Aug 07 Redis
面试分析分布式架构Redis热点key大Value解决方案
Mar 13 Redis
Redis调用Lua脚本及使用场景快速掌握
Mar 16 Redis
windows安装 redis 6.2.6最新步骤详解
Apr 26 Redis
浅谈Redis的事件驱动模型
May 30 Redis
Redis基本数据类型String常用操作命令
Jun 01 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
《魔兽世界》惊魂幻象将获得调整
2020/03/08 其他游戏
PHP字符串函数系列之nl2br(),在字符串中的每个新行 (\n) 之前插入 HTML 换行符br
2011/11/10 PHP
Destoon旺旺无法正常显示,点击提示“会员名不存在”的解决办法
2014/06/21 PHP
PHP使用mysqldump命令导出数据库
2015/04/14 PHP
yii2 RBAC使用DbManager实现后台权限判断的方法
2016/07/23 PHP
ThinkPHP 模板substr的截取字符串函数详解
2017/01/09 PHP
laravel框架数据库操作、查询构建器、Eloquent ORM操作实例分析
2019/12/20 PHP
PHP实现获取文件mime类型多种方法解析
2020/05/28 PHP
JQuery 遮罩层实现(mask)实现代码
2010/01/09 Javascript
JS使用replace()方法和正则表达式进行字符串的搜索与替换实例
2014/04/10 Javascript
jquery注册文本框获取焦点清空,失去焦点赋值的简单实例
2016/09/08 Javascript
JS动态给对象添加属性和值的实现方法
2016/10/21 Javascript
关于vue状态过渡transition不起作用的原因解决
2019/04/09 Javascript
详解nvm管理多版本node踩坑
2019/07/26 Javascript
JS 自执行函数原理及用法
2019/08/05 Javascript
JavaScript实现烟花绽放动画效果
2020/08/04 Javascript
Javascript如何递归遍历本地文件夹
2020/08/06 Javascript
[03:57]《不朽》——2015DOTA2国际邀请赛—中国军团出征主题曲MV
2015/07/15 DOTA
python3使用pyqt5制作一个超简单浏览器的实例
2017/10/19 Python
手把手教你python实现SVM算法
2017/12/27 Python
python+tkinter实现学生管理系统
2019/08/20 Python
关于Python不换行输出和不换行输出end=““不显示的问题(亲测已解决)
2020/10/27 Python
英国健康和美容技术产品购物网站:CurrentBody
2019/07/17 全球购物
HOTEL INFO英国:搜索全球酒店
2019/08/08 全球购物
大学四年的个人自我评价
2014/01/14 职场文书
在校硕士自我鉴定
2014/01/23 职场文书
代理协议书
2014/04/22 职场文书
我的教育故事演讲稿
2014/05/04 职场文书
档案信息化建设方案
2014/05/16 职场文书
学习优秀党员杨宗兴先进事迹材料思想汇报
2014/09/14 职场文书
预备党员群众路线教育实践活动思想汇报2014
2014/10/25 职场文书
2014年物业管理工作总结
2014/11/21 职场文书
药店营业员岗位职责
2015/04/14 职场文书
2015年党小组工作总结
2015/05/26 职场文书
社会实践单位意见
2015/06/05 职场文书
学校食堂管理制度
2015/08/04 职场文书