解决 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在直播场景的实践方案
Apr 27 Redis
基于Redis实现分布式锁的方法(lua脚本版)
May 12 Redis
浅谈redis缓存在项目中的使用
May 20 Redis
Redis 配置文件重要属性的具体使用
May 20 Redis
Redis集群的关闭与重启操作
Jul 07 Redis
缓存替换策略及应用(以Redis、InnoDB为例)
Jul 25 Redis
redis 存储对象的方法对比分析
Aug 02 Redis
Window server中安装Redis的超详细教程
Nov 17 Redis
聊聊redis-dump工具安装问题
Jan 18 Redis
使用Redis实现点赞取消点赞的详细代码
Mar 20 Redis
解决 Redis 秒杀超卖场景的高并发
Apr 12 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 遍历文件实现代码
2011/05/04 PHP
php使用imagick模块实现图片缩放、裁剪、压缩示例
2014/04/17 PHP
php 模拟 asp.net webFrom 按钮提交事件实例
2014/10/13 PHP
PHP产生不重复随机数的5个方法总结
2014/11/12 PHP
浅谈PHP命令执行php文件需要注意的问题
2016/12/16 PHP
ThinkPHP 3使用OSS的方法
2018/07/19 PHP
javascript时间自动刷新实现原理与步骤
2013/01/06 Javascript
jQuery中slice()方法用法实例
2015/01/07 Javascript
Jquery实现地铁线路指示灯提示牌效果的方法
2015/03/02 Javascript
再谈JavaScript线程
2015/07/10 Javascript
js父页面中使用子页面的方法
2016/01/09 Javascript
javaScript数组迭代方法详解
2016/04/14 Javascript
全面了解构造函数继承关键apply call
2016/07/26 Javascript
网页瀑布流布局jQuery实现代码
2016/10/21 Javascript
AngularJS动态加载模块和依赖的方法分析
2016/11/08 Javascript
jquery replace方法去空格
2017/05/08 jQuery
nodejs接入阿里大鱼短信验证码的方法
2017/07/10 NodeJs
JSON创建键值对(key是中文或者数字)方式详解
2017/08/24 Javascript
node.js中使用Export和Import的方法
2017/09/18 Javascript
微信小程序倒计时功能实现代码
2017/11/09 Javascript
Vue项目中使用better-scroll实现一个轮播图自动播放功能
2018/12/03 Javascript
python在Windows8下获取本机ip地址的方法
2015/03/14 Python
Python的设计模式编程入门指南
2015/04/02 Python
numpy 进行数组拼接,分别在行和列上合并的实例
2018/05/08 Python
在PyCharm下打包*.py程序成.exe的方法
2018/11/29 Python
Python同步遍历多个列表的示例
2019/02/19 Python
手写一个python迭代器过程详解
2019/08/27 Python
使用 Python 写一个简易的抽奖程序
2019/12/08 Python
基于python计算滚动方差(标准差)talib和pd.rolling函数差异详解
2020/06/08 Python
利用Python实现朋友圈中的九宫格图片效果
2020/09/03 Python
Python 用__new__方法实现单例的操作
2020/12/11 Python
Timberland法国官网:购买靴子、鞋子、衣服、夹克和配饰
2019/11/30 全球购物
女方回门宴答谢词
2014/01/14 职场文书
医院节能减排方案
2014/06/13 职场文书
简单的辞职信怎么写
2015/02/28 职场文书
windows server 2012安装FTP并配置被动模式指定开放端口
2022/06/10 Servers