解决 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 13 Redis
redis实现的四种常见限流策略
Jun 18 Redis
Redis性能监控的实现
Jul 09 Redis
Redis Cluster集群动态扩容的实现
Jul 15 Redis
浅谈Redis位图(Bitmap)及Redis二进制中的问题
Jul 15 Redis
Redis 持久化 RDB 与 AOF的执行过程
Nov 07 Redis
Redis中有序集合的内部实现方式的详细介绍
Mar 16 Redis
一文搞懂Redis中String数据类型
Apr 03 Redis
redis 解决库存并发问题实现数量控制
Apr 08 Redis
muduo TcpServer模块源码分析
Apr 26 Redis
详解Redis的三种常用的缓存读写策略步骤
May 06 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 服务器调试 Zend Debugger 的安装教程
2009/09/25 PHP
PHP 使用memcached简单示例分享
2015/03/05 PHP
PHP基于array_unique实现二维数组去重
2020/07/14 PHP
javascript 解决表单仍然提交即使监听处理函数返回false
2010/03/14 Javascript
JavaScript高级程序设计 DOM学习笔记
2011/09/10 Javascript
JavaScript实现大数的运算
2014/11/24 Javascript
Javascript 运动中Offset的bug解决方案
2014/12/24 Javascript
javascript实现tab切换的四种方法
2015/11/05 Javascript
JavaScript每天必学之数组和对象部分
2016/09/17 Javascript
微信小程序 swiper制作tab切换实现附源码
2017/01/21 Javascript
vue实现全选和反选功能
2017/08/31 Javascript
vue同步父子组件和异步父子组件的生命周期顺序问题
2018/10/07 Javascript
15 分钟掌握vue-next响应式原理
2019/10/13 Javascript
Python编程中实现迭代器的一些技巧小结
2016/06/21 Python
python用装饰器自动注册Tornado路由详解
2017/02/14 Python
Python基于回溯法子集树模板实现8皇后问题
2017/09/01 Python
Python使用asyncio包处理并发详解
2017/09/09 Python
Python使用Matplotlib实现Logos设计代码
2017/12/25 Python
python距离测量的方法
2018/03/06 Python
使用pandas对矢量化数据进行替换处理的方法
2018/04/11 Python
wxPython的安装与使用教程
2018/08/31 Python
django框架自定义模板标签(template tag)操作示例
2019/06/24 Python
Django 项目重命名的实现步骤解析
2019/08/14 Python
wxPython电子表格功能wx.grid实例教程
2019/11/19 Python
在flask中使用python-dotenv+flask-cli自定义命令(推荐)
2020/01/05 Python
使用Pyhton 分析酒店针孔摄像头
2020/03/04 Python
西班牙拥有最佳品牌的动物商店:Animalear.com
2018/01/05 全球购物
经济实惠的豪华背包和行李袋:Packs Project
2018/10/17 全球购物
绿色美容,有机护肤品和化妆品:Safe & Chic
2018/10/29 全球购物
SQL Server的固定数据库角色都有哪些?对应的服务器权限有哪些?
2013/05/18 面试题
公司晚会主持词
2014/03/22 职场文书
无犯罪记录证明
2014/09/19 职场文书
党员个人自我评价
2015/03/03 职场文书
劳动仲裁代理词范文
2015/05/25 职场文书
怎么用Python识别手势数字
2021/06/07 Python