解决 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
为Java项目添加Redis缓存的方法
May 18 Redis
详解Redis复制原理
Jun 04 Redis
Redis主从配置和底层实现原理解析(实战记录)
Jun 30 Redis
Redis性能监控的实现
Jul 09 Redis
厉害!这是Redis可视化工具最全的横向评测
Jul 15 Redis
Redis分布式锁Redlock的实现
Aug 07 Redis
Redis高并发防止秒杀超卖实战源码解决方案
Nov 01 Redis
redis复制有可能碰到的问题汇总
Apr 03 Redis
详解Redis的三种常用的缓存读写策略步骤
May 06 Redis
Redis特殊数据类型HyperLogLog基数统计算法讲解
Jun 01 Redis
利用Redis实现点赞功能的示例代码
Jun 28 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动态图像的创建
2006/10/09 PHP
php 高性能书写
2010/12/11 PHP
PHP 闭包详解及实例代码
2016/09/28 PHP
php生成与读取excel文件
2016/10/14 PHP
php脚本守护进程原理与实现方法详解
2017/07/20 PHP
PHP实现压缩图片尺寸并转为jpg格式的方法示例
2018/05/10 PHP
PHP7匿名类的用法示例
2019/04/05 PHP
html+javascript实现可拖动可提交的弹出层对话框效果
2013/08/05 Javascript
Array栈方法和队列方法的特点说明
2014/01/24 Javascript
一个JavaScript递归实现反转数组字符串的实例
2014/10/14 Javascript
JavaScript截断字符串的方法
2015/07/15 Javascript
js控制台输出的方法(详解)
2016/11/26 Javascript
JavaScript调试的多个必备小Tips
2017/01/15 Javascript
jQuery EasyUI Draggable拖动组件
2017/03/01 Javascript
JS抛物线动画实例制作
2018/02/24 Javascript
Vue cli构建及项目打包以及出现的问题解决
2018/08/27 Javascript
vue中使用GraphQL的实例代码
2019/11/04 Javascript
jQuery实现的分页插件完整示例
2020/05/26 jQuery
多个Vue项目部署到服务器的步骤记录
2020/10/22 Javascript
简单谈谈Python中的闭包
2016/11/30 Python
python在非root权限下的安装方法
2018/01/23 Python
Python实现决策树C4.5算法的示例
2018/05/30 Python
Python爬虫实现简单的爬取有道翻译功能示例
2018/07/13 Python
对numpy中二进制格式的数据存储与读取方法详解
2018/11/01 Python
使用django实现一个代码发布系统
2019/07/18 Python
keras的三种模型实现与区别说明
2020/07/03 Python
Python模拟键盘输入自动登录TGP
2020/11/27 Python
纯CSS打造(无图像无js)的非常流行的讲话(语音)气泡效果
2012/12/28 HTML / CSS
意大利体育用品和运动服网上商店:Maxi Sport
2019/09/14 全球购物
无偿献血倡议书
2014/04/14 职场文书
不忘国耻振兴中华演讲稿
2014/05/14 职场文书
卖车协议书范例
2014/09/16 职场文书
初中生物教学反思
2016/02/20 职场文书
2016年“12.3”国际残疾人日活动总结
2016/04/01 职场文书
详解Python函数print用法
2021/06/18 Python
「租借女友」第2季樱泽墨角色PV&新视觉图公开
2022/03/21 日漫