解决 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持久化与主从复制的实践
Apr 27 Redis
在K8s上部署Redis集群的方法步骤
Apr 27 Redis
redis 查看所有的key方式
May 07 Redis
redis内存空间效率问题的深入探究
May 17 Redis
Windows下redis下载、redis安装及使用教程
Jun 02 Redis
Redis性能监控的实现
Jul 09 Redis
Redis中一个String类型引发的惨案
Jul 25 Redis
Redis 常见使用场景
Aug 30 Redis
解决linux下redis数据库overcommit_memory问题
Feb 24 Redis
Redis如何使用乐观锁(CAS)保证数据一致性
Mar 25 Redis
 Redis 串行生成顺序编码的方法实现
Apr 03 Redis
Redis如何实现验证码发送 以及限制每日发送次数
Apr 18 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
mysql_fetch_assoc和mysql_fetch_row的功能加起来就是mysql_fetch_array
2007/01/15 PHP
PHP自动重命名文件实现方法
2014/11/04 PHP
使用Composer安装Yii框架的方法
2016/03/15 PHP
PHP云打印类完整示例
2016/10/15 PHP
JavaScript 5 新增 Array 方法实现介绍
2012/02/06 Javascript
JS打印gridview实现原理及代码
2013/02/05 Javascript
jquery全选/全不选/反选另一种实现方法(配合原生js)
2013/04/07 Javascript
javascript自定义函数参数传递为字符串格式
2014/07/29 Javascript
vue.js指令和组件详细介绍及实例
2017/04/06 Javascript
Angular 4依赖注入学习教程之FactoryProvider配置依赖对象(五)
2017/06/04 Javascript
详解nodejs模板引擎制作
2017/06/14 NodeJs
详解JavaScript中的六种错误类型
2017/09/21 Javascript
基于JavaScript实现表格滚动分页
2017/11/22 Javascript
Vue.js进阶知识点总结
2018/04/01 Javascript
JS求Number类型数组中最大元素方法
2018/04/08 Javascript
如何从头实现一个node.js的koa框架
2019/06/17 Javascript
Vue开发环境中修改端口号的实现方法
2019/08/15 Javascript
Jquery 动态添加元素并添加点击事件实现过程解析
2019/10/12 jQuery
[31:01]2014 DOTA2国际邀请赛中国区预选赛5.21 CNB VS Orenda
2014/05/23 DOTA
Python使用matplotlib绘制正弦和余弦曲线的方法示例
2018/01/06 Python
Python基于hashlib模块的文件MD5一致性加密验证示例
2018/02/10 Python
pandas 小数位数 精度的处理方法
2018/06/09 Python
Python实用工具FuckIt.py介绍
2019/07/02 Python
浅谈python已知元素,获取元素索引(numpy,pandas)
2019/11/26 Python
Django框架获取form表单数据方式总结
2020/04/22 Python
通过一张图教会你CSS3倒影的实现
2017/09/26 HTML / CSS
北美三大旅游网站之一:Travelocity
2017/08/12 全球购物
Melissa鞋英国官方网站:Nonnon
2019/05/01 全球购物
高校教师自荐信范文
2014/03/13 职场文书
初三学习计划书范文
2014/04/30 职场文书
自我检讨报告
2015/01/28 职场文书
介绍信的写法
2015/01/31 职场文书
城南旧事观后感
2015/06/11 职场文书
初一军训感言
2015/08/01 职场文书
Python基础之教你怎么在M1系统上使用pandas
2021/05/08 Python
详解MySQL连接挂死的原因
2021/05/18 MySQL