解决 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遍历所有key的两个命令(KEYS 和 SCAN)
Apr 12 Redis
redis三种高可用方式部署的实现
May 11 Redis
基于Redis实现分布式锁的方法(lua脚本版)
May 12 Redis
Redis高级数据类型Hyperloglog、Bitmap的使用
May 24 Redis
了解Redis常见应用场景
Jun 23 Redis
浅谈Redis中的RDB快照
Jun 29 Redis
浅谈Redis位图(Bitmap)及Redis二进制中的问题
Jul 15 Redis
基于Redis结合SpringBoot的秒杀案例详解
Oct 05 Redis
Redis三种集群模式详解
Oct 05 Redis
redis数据结构之压缩列表
Mar 21 Redis
 Redis 串行生成顺序编码的方法实现
Apr 03 Redis
Redis配置外网可访问(redis远程连接不上)的方法
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
实用函数10
2007/11/08 PHP
php下通过IP获取地理位置的代码(小偷程序)
2011/06/09 PHP
PHP获取文件后缀名的三个函数
2012/10/15 PHP
PHP如何将XML转成数组
2016/04/04 PHP
解决Laravel5.2 Auth认证退出失效的问题
2019/10/14 PHP
PHP使用PDO实现mysql防注入功能详解
2019/12/20 PHP
JavaScript中的Location地址对象
2008/01/16 Javascript
javascript 进度条 实现代码
2009/07/30 Javascript
ExtJs 3.1 XmlTreeLoader Example Error
2010/02/09 Javascript
javascript encodeURI和encodeURIComponent的比较
2010/04/03 Javascript
关于跨站脚本攻击问题
2011/12/22 Javascript
分析Node.js connect ECONNREFUSED错误
2013/04/09 Javascript
jQuery之字体大小的设置方法
2014/02/27 Javascript
javascript实现单击和双击并存的方法
2014/12/13 Javascript
详解Javascript中的Object对象
2016/02/28 Javascript
JS图片放大效果简单实现代码
2016/09/08 Javascript
如何给ss bash 写一个 WEB 端查看流量的页面
2017/03/23 Javascript
微信小程序城市定位的实现实例(获取当前所在国家城市信息)
2017/05/17 Javascript
Thinkjs3新手入门之如何使用静态资源目录
2017/12/06 Javascript
分享vue里swiper的一些坑
2018/08/30 Javascript
Vue+Django项目部署详解
2019/05/30 Javascript
ES2020 新特性(种草)
2020/01/12 Javascript
Nest.js环境变量配置与序列化详解
2021/02/21 Javascript
pandas修改DataFrame列名的方法
2018/04/08 Python
pandas实现将dataframe满足某一条件的值选出
2019/06/12 Python
Tensorflow 多线程设置方式
2020/02/06 Python
Python实现SMTP邮件发送
2020/06/16 Python
Python gevent协程切换实现详解
2020/09/14 Python
大学生护理专业自荐信
2013/10/03 职场文书
大学老师推荐信
2014/02/25 职场文书
乡镇纠风工作实施方案
2014/03/22 职场文书
环保建议书200字
2014/05/14 职场文书
秋季运动会演讲稿
2014/09/16 职场文书
学校政风行风自查自纠报告
2014/10/21 职场文书
导游词范文之颐和园/重庆/云台山
2019/09/10 职场文书
详解Vue的options
2021/05/15 Vue.js