解决 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通过6379端口无法连接服务器(redis-server.exe闪退)
May 08 Redis
基于Redis过期事件实现订单超时取消
May 08 Redis
Redis数据结构之链表与字典的使用
May 11 Redis
Redis 哨兵集群的实现
Jun 18 Redis
压缩Redis里的字符串大对象操作
Jun 23 Redis
Redis性能监控的实现
Jul 09 Redis
Redis Cluster 集群搭建你会吗
Aug 04 Redis
SpringBoot集成Redis的思路详解
Oct 16 Redis
浅谈Redis的事件驱动模型
May 30 Redis
Redis实现短信验证码登录的示例代码
Jun 14 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
PHP 巧用数组降低程序的时间复杂度
2010/01/01 PHP
PHP游戏编程25个脚本代码
2011/02/08 PHP
php5.x禁用eval的操作方法
2018/10/19 PHP
javascript 面向对象的JavaScript类
2010/05/04 Javascript
Jquery 最近浏览过的商品的功能实现代码
2010/05/14 Javascript
js模拟滚动条(横向竖向)
2013/02/22 Javascript
Javascript事件实例详解
2013/11/06 Javascript
IE的事件传递-event.cancelBubble示例介绍
2014/01/12 Javascript
javascript轻量级模板引擎juicer使用指南
2014/06/22 Javascript
Bootstrap选项卡与Masonry插件的完美结合
2016/07/06 Javascript
纯JavaScript手写图片轮播代码
2016/10/20 Javascript
Angularjs中三种数据的绑定策略(“@”,“=”,“&”)
2016/12/23 Javascript
JS实现课堂随机点名和顺序点名
2017/03/09 Javascript
bootstrap模态框关闭后清除模态框的数据方法
2018/08/10 Javascript
解决vue.js this.$router.push无效的问题
2018/09/03 Javascript
jQuery实现的导航条点击后高亮显示功能示例
2019/03/04 jQuery
JS异步错误捕获的一些事小结
2019/04/26 Javascript
基于JavaScript获取base64图片大小
2019/10/18 Javascript
关于vue.js中实现方法内某些代码延时执行
2019/11/14 Javascript
JS制作简易计算器的实例代码
2020/07/04 Javascript
[01:09:23]KG vs TNC 2019国际邀请赛小组赛 BO2 第一场 8.15
2019/08/16 DOTA
Python简单调用MySQL存储过程并获得返回值的方法
2015/07/20 Python
举例讲解Python中的list列表数据结构用法
2016/03/12 Python
TensorFlow实现Logistic回归
2018/09/07 Python
Python双链表原理与实现方法详解
2020/02/22 Python
python——全排列数的生成方式
2020/02/26 Python
基于OpenCV的路面质量检测的实现
2020/11/04 Python
Kusmi茶美国官网:优质散叶茶和茶包
2019/10/13 全球购物
Jdbc数据访问技术面试题
2012/03/30 面试题
运动会解说词200字
2014/02/06 职场文书
周年庆典主持词
2014/04/02 职场文书
群众路线领导班子整改方案
2014/10/25 职场文书
瞿秋白纪念馆观后感
2015/06/10 职场文书
从事会计工作年限证明
2015/06/23 职场文书
中学音乐课教学反思
2016/02/18 职场文书
使用 MybatisPlus 连接 SqlServer 数据库解决 OFFSET 分页问题
2022/04/22 SQL Server