解决 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缓存-序列化对象存储乱码问题的解决
Jun 21 Redis
基于Redis的List实现特价商品列表功能
Aug 30 Redis
Redis字典实现、Hash键冲突及渐进式rehash详解
Sep 04 Redis
Redis RDB技术底层原理详解
Sep 04 Redis
Redis高可用集群redis-cluster详解
Mar 20 Redis
redis 解决库存并发问题实现数量控制
Apr 08 Redis
Redis数据同步之redis shake的实现方法
Apr 21 Redis
Redis 限流器
May 15 Redis
Redis 异步机制
May 15 Redis
Redis实现订单过期删除的方法步骤
Jun 05 Redis
Redis sentinel哨兵集群的实现步骤
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
一个用于网络的工具函数库
2006/10/09 PHP
php jquery 实现新闻标签分类与无刷新分页
2009/12/18 PHP
ThinkPHP中RBAC类的四种用法分析
2014/11/24 PHP
PHP yii实现model添加默认值的方法(两种方法)
2016/11/10 PHP
网站被恶意镜像怎么办 php一段代码轻松搞定(全面版)
2018/10/23 PHP
基于laravel belongsTo使用详解
2019/10/18 PHP
获取DOM对象的几种扩展及简写
2006/10/09 Javascript
jquery插件orbit.js实现图片折叠轮换特效
2015/04/14 Javascript
jQuery实用技巧必备(上)
2015/11/02 Javascript
AngularJs Forms详解及简单示例
2016/09/01 Javascript
jQuery css() 方法动态修改CSS属性
2016/09/25 Javascript
bootstrapValidator bootstrap-select验证不可用的解决办法
2017/01/11 Javascript
vue组件如何被其他项目引用
2017/04/13 Javascript
js实现Tab选项卡切换效果
2020/07/17 Javascript
详解Webpack+Babel+React开发环境的搭建的方法步骤
2018/01/09 Javascript
jQuery实现动态显示select下拉列表数据的方法
2018/02/05 jQuery
Vue.js样式动态绑定实现小结
2019/01/24 Javascript
vue用elementui写form表单时,在label里添加空格操作
2020/08/13 Javascript
一个检测OpenSSL心脏出血漏洞的Python脚本分享
2014/04/10 Python
python re正则表达式模块(Regular Expression)
2014/07/16 Python
在Python中使用next()方法操作文件的教程
2015/05/24 Python
Python 记录日志的灵活性和可配置性介绍
2018/02/27 Python
Python简单实现的代理服务器端口映射功能示例
2018/04/08 Python
Pandas读写CSV文件的方法示例
2019/03/27 Python
Python常用模块之requests模块用法分析
2019/05/15 Python
详解Python下载图片并保存本地的两种方式
2019/05/15 Python
对python中的float除法和整除法的实例详解
2019/07/20 Python
python实现桌面气泡提示功能
2019/07/29 Python
详解python中__name__的意义以及作用
2019/08/07 Python
aws 通过boto3 python脚本打pach的实现方法
2020/05/10 Python
加拿大在线眼镜零售商:SmartBuyGlasses加拿大
2019/05/25 全球购物
公司领导推荐信
2013/11/12 职场文书
大四优秀党员个人民主评议
2014/09/19 职场文书
团代会邀请函
2015/02/02 职场文书
2019大学生暑期实习心得总结
2019/08/21 职场文书
OpenCV-Python实现油画效果的实例
2021/06/08 Python