解决 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 11 Redis
详解Redis集群搭建的三种方式
May 31 Redis
redis客户端实现高可用读写分离的方式详解
Jul 04 Redis
Redis性能监控的实现
Jul 09 Redis
Redis做数据持久化的解决方案及底层原理
Jul 15 Redis
关于redisson缓存序列化几枚大坑说明
Aug 04 Redis
SpringBoot整合Redis入门之缓存数据的方法
Nov 17 Redis
聊聊redis-dump工具安装问题
Jan 18 Redis
解决 Redis 秒杀超卖场景的高并发
Apr 12 Redis
浅谈Redis变慢的原因及排查方法
Jun 21 Redis
redis lua限流算法实现示例
Jul 15 Redis
Redis实战之Lettuce的使用技巧详解
Dec 24 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原理之错误抑制与内嵌HTML分析
2011/05/02 PHP
ajax取消挂起请求的处理方法
2013/03/18 PHP
php制作文本式留言板
2015/03/18 PHP
Laravel框架路由和控制器的绑定操作方法
2018/06/12 PHP
PHP抽象类和接口用法实例详解
2019/07/20 PHP
JavaScript 继承详解(三)
2009/07/13 Javascript
Js实现双击鼠标自动滚动屏幕的示例代码
2013/12/14 Javascript
Js冒泡事件详解及阻止示例
2014/03/21 Javascript
js控制文本框输入的字符类型方法汇总
2015/06/19 Javascript
Nodejs中解决cluster模块的多进程如何共享数据问题
2016/11/10 NodeJs
基于JSON数据格式详解
2017/08/31 Javascript
详解react-native WebView 返回处理(非回调方法可解决)
2018/02/27 Javascript
webpack打包多页面的方法
2018/11/30 Javascript
通过图带你深入了解vue的响应式原理
2019/06/21 Javascript
layui默认选中table的CheckBox复选框方法
2019/09/19 Javascript
微信小程序自定义tabBar在uni-app的适配详解
2019/09/30 Javascript
vue实现将一个数组内的相同数据进行合并
2019/11/07 Javascript
jQuery实现获取多选框的值示例
2020/02/07 jQuery
Python下rrdtool模块的基本使用方法
2015/11/13 Python
简介Python的collections模块中defaultdict类型的用法
2016/07/07 Python
Python实现桶排序与快速排序算法结合应用示例
2017/11/22 Python
基于python实现在excel中读取与生成随机数写入excel中
2018/01/04 Python
python复制文件到指定目录的实例
2018/04/27 Python
解决python爬虫中有中文的url问题
2018/05/11 Python
Python字符串内置函数功能与用法总结
2019/04/16 Python
python3.4+pycharm 环境安装及使用方法
2019/06/13 Python
Python画图实现同一结点多个柱状图的示例
2019/07/07 Python
使用python 的matplotlib 画轨道实例
2020/01/19 Python
解决python对齐错误的方法
2020/07/16 Python
Python实现JS解密并爬取某音漫客网站
2020/10/23 Python
乐天旅游香港网站:日本饭店预订
2017/11/29 全球购物
攀岩、滑雪、徒步旅行装备:Black Diamond Equipment
2019/08/16 全球购物
2014年保卫部工作总结
2014/11/21 职场文书
食品药品安全责任书
2015/05/11 职场文书
实验室安全管理制度
2015/08/05 职场文书
小学生班干部竞选稿
2015/11/20 职场文书