解决 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 08 Redis
redis三种高可用方式部署的实现
May 11 Redis
浅谈redis缓存在项目中的使用
May 20 Redis
详解缓存穿透击穿雪崩解决方案
May 28 Redis
嵌入式Redis服务器在Spring Boot测试中的使用教程
Jul 21 Redis
详解redis在微服务领域的贡献
Oct 16 Redis
Window server中安装Redis的超详细教程
Nov 17 Redis
Springboot/Springcloud项目集成redis进行存取的过程解析
Dec 04 Redis
 Redis 串行生成顺序编码的方法实现
Apr 03 Redis
浅谈Redis的事件驱动模型
May 30 Redis
Redis特殊数据类型HyperLogLog基数统计算法讲解
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
关于BIG5-HKSCS的解决方法
2007/03/20 PHP
PHP不用递归实现无限分级的例子分享
2014/04/18 PHP
PHP中的函数声明与使用详解
2017/05/27 PHP
[原创]PHP正则匹配中英文、数字及下划线的方法【用户名验证】
2017/08/01 PHP
PHP自动载入类文件函数__autoload的使用方法
2019/03/25 PHP
Javascript中的常见排序算法
2007/03/27 Javascript
Bootstrap Table使用整理(四)之工具栏
2017/06/09 Javascript
[js高手之路]HTML标签解释成DOM节点的实现方法
2017/08/31 Javascript
js的继承方法小结(prototype、call、apply)(推荐)
2019/04/17 Javascript
vue - vue.config.js中devServer配置方式
2019/10/30 Javascript
vue中移动端调取本地的复制的文本方式
2020/07/18 Javascript
React倒计时功能实现代码——解耦通用
2020/09/18 Javascript
[01:01:25]DOTA2上海特级锦标赛B组资格赛#2 Fnatic VS Spirit第三局
2016/02/27 DOTA
[35:39]完美世界DOTA2联赛PWL S2 FTD.C vs Rebirth 第二场 11.22
2020/11/24 DOTA
Python enumerate遍历数组示例应用
2008/09/06 Python
python基础教程之基本数据类型和变量声明介绍
2014/08/29 Python
深入解答关于Python的11道基本面试题
2017/04/01 Python
详解Python自建logging模块
2018/01/29 Python
浅析python继承与多重继承
2018/09/13 Python
python使用phoenixdb操作hbase的方法示例
2019/02/28 Python
Python3模拟curl发送post请求操作示例
2019/05/03 Python
Python GUI编程 文本弹窗的实例
2019/06/11 Python
python super用法及原理详解
2020/01/20 Python
使用keras时input_shape的维度表示问题说明
2020/06/29 Python
Watchshop德国:欧洲在线手表No.1
2019/06/20 全球购物
HOTEL INFO英国:搜索全球酒店
2019/08/08 全球购物
Foot Locker澳洲官网:美国运动服和鞋类零售商
2019/10/11 全球购物
语文教育专业应届生求职信
2013/11/23 职场文书
翻译学院毕业生自荐书
2014/02/02 职场文书
委托证明书
2014/09/17 职场文书
教师国庆节演讲稿范文2014
2014/09/21 职场文书
2014年党员自我剖析材料
2014/10/07 职场文书
详解Python牛顿插值法
2021/05/11 Python
Log4j.properties配置及其使用
2021/08/02 Java/Android
天谕手游15杯全调酒配方和调酒券的获得方式
2022/04/06 其他游戏
Python之matplotlib绘制饼图
2022/04/13 Python