解决 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 12 Redis
Redis集群新增、删除节点以及动态增加内存的方法
Sep 04 Redis
Redis三种集群模式详解
Oct 05 Redis
详解redis在微服务领域的贡献
Oct 16 Redis
SpringBoot整合Redis入门之缓存数据的方法
Nov 17 Redis
Redis中缓存穿透/击穿/雪崩问题和解决方法
Dec 04 Redis
Redis命令处理过程源码解析
Feb 12 Redis
浅谈Redis跟MySQL的双写问题解决方案
Feb 24 Redis
面试分析分布式架构Redis热点key大Value解决方案
Mar 13 Redis
在Centos 8.0中安装Redis服务器的教程详解
Mar 21 Redis
Redis 报错 error:NOAUTH Authentication required
May 15 Redis
Redis Lua脚本实现ip限流示例
Jul 15 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实现登陆模块功能示例
2016/10/20 PHP
php PDO实现的事务回滚示例
2017/03/23 PHP
Laravel 实现密码重置功能
2018/02/23 PHP
laravel excel 上传文件保存到本地服务器功能
2019/11/14 PHP
php实现记事本案例
2020/10/20 PHP
JavaScript定义类或函数的几种方式小结
2011/01/09 Javascript
JqueryMobile动态生成listView并实现刷新的两种方法
2014/03/05 Javascript
javascript绘制漂亮的心型线效果完整实例
2016/02/02 Javascript
javascript仿京东导航左侧分类导航下拉菜单效果
2020/11/25 Javascript
弹出遮罩层后禁止滚动效果【实现代码】
2016/04/29 Javascript
JS中动态创建元素的三种方法总结(推荐)
2016/10/20 Javascript
ionic2 tabs 图标自定义实例
2017/03/08 Javascript
详解vue 模版组件的三种用法
2017/07/21 Javascript
webpack里使用jquery.mCustomScrollbar插件的方法
2018/05/30 jQuery
微信小程序解除10个请求并发限制
2018/12/18 Javascript
JavaScript常见事件处理程序实例总结
2019/01/05 Javascript
深入浅出 Vue 系列 -- 数据劫持实现原理
2019/04/23 Javascript
vue中 数字相加为字串转化为数值的例子
2019/11/07 Javascript
[01:07:46]完美世界DOTA2联赛循环赛 Magma vs IO BO2第二场 11.01
2020/11/02 DOTA
Python版的文曲星猜数字游戏代码
2013/09/02 Python
Python中使用ElementTree解析XML示例
2015/06/02 Python
Python中规范定义命名空间的一些建议
2016/06/04 Python
对python requests发送json格式数据的实例详解
2018/12/19 Python
俄罗斯设计师家具购物网站:The Furnish
2019/12/01 全球购物
软件工程师面试题
2012/06/25 面试题
农业大学毕业生的个人自我评价
2013/10/11 职场文书
两年的个人工作自我评价
2014/01/10 职场文书
致标枪运动员广播稿
2014/02/06 职场文书
《满井游记》教学反思
2014/02/26 职场文书
文明演讲稿范文
2014/05/12 职场文书
校运会口号
2014/06/18 职场文书
“向国旗敬礼”活动策划方案(4篇)
2014/09/27 职场文书
装修公司管理制度
2015/08/05 职场文书
2019年大学推荐信
2019/06/24 职场文书
Golang Elasticsearches 批量修改查询及发送MQ
2022/04/19 Golang
Java8 CompletableFuture 异步回调
2022/04/28 Java/Android