解决 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
Windows下redis下载、redis安装及使用教程
Jun 02 Redis
Redis缓存-序列化对象存储乱码问题的解决
Jun 21 Redis
Redis性能监控的实现
Jul 09 Redis
redis 存储对象的方法对比分析
Aug 02 Redis
解析redis hash应用场景和常用命令
Aug 04 Redis
Redis命令处理过程源码解析
Feb 12 Redis
解决linux下redis数据库overcommit_memory问题
Feb 24 Redis
Redis监控工具RedisInsight安装与使用
Mar 21 Redis
Redis安装使用RedisJSON模块的方法
Mar 23 Redis
redis sentinel监控高可用集群实现的配置步骤
Apr 01 Redis
Redis基本数据类型Set常用操作命令
Jun 01 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
JAVA/JSP学习系列之七
2006/10/09 PHP
smarty section简介与用法分析
2008/10/03 PHP
PHP中使用socket方式GET、POST数据实例
2015/04/02 PHP
php+flash+jQuery多图片上传源码分享
2020/07/27 PHP
基于ThinkPHP5.0实现图片上传插件
2017/09/25 PHP
比较详细的javascript对象的property和prototype是什么一种关系
2007/08/06 Javascript
javascript开发中因空格引发的错误
2010/11/08 Javascript
jquery获取div距离窗口和父级dv的距离示例
2013/10/10 Javascript
判断滚动条到底部的JS代码
2013/11/04 Javascript
详解JavaScript for循环中发送AJAX请求问题
2020/06/23 Javascript
jQuery bt气泡实现悬停显示及移开隐藏功能的方法
2016/07/12 Javascript
js实现动态创建的元素绑定事件
2016/07/19 Javascript
Bootstrap基本组件学习笔记之按钮组(8)
2016/12/07 Javascript
详解用node-images 打造简易图片服务器
2017/05/08 Javascript
详解Angular2 关于*ngFor 嵌套循环
2017/05/22 Javascript
一个Vue页面的内存泄露分析详解
2018/06/25 Javascript
vue打包使用Nginx代理解决跨域问题
2018/08/27 Javascript
详解用场景去理解函数柯里化(入门篇)
2019/04/11 Javascript
微信浏览器左上角返回按钮监听的实现
2020/03/04 Javascript
Python、Javascript中的闭包比较
2015/02/04 Python
Python数据结构与算法之图结构(Graph)实例分析
2017/09/05 Python
pytorch 数据集图片显示方法
2018/07/26 Python
利用Pandas和Numpy按时间戳将数据以Groupby方式分组
2019/07/22 Python
python 根据网易云歌曲的ID 直接下载歌曲的实例
2019/08/24 Python
Python爬虫之Selenium中frame/iframe表单嵌套页面
2020/12/04 Python
环法自行车赛官方商店:Le Tour de France
2017/08/27 全球购物
美国娱乐和流行文化商品店:FYE
2017/09/14 全球购物
秋天的图画教学反思
2014/05/01 职场文书
推荐信格式范文
2014/05/09 职场文书
给校长的建议书200字
2014/05/16 职场文书
安全生产目标管理责任书
2014/07/25 职场文书
股权转让协议范本
2014/12/07 职场文书
员工辞职信范文大全
2015/05/12 职场文书
php png失真的原因及解决办法
2021/11/17 PHP
Windows 64位 安装 mysql 8.0.28 图文教程
2022/04/19 MySQL
SQL Server #{}可以防止SQL注入
2022/05/11 SQL Server