解决 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 12 Redis
Redis IP地址的绑定的实现
May 08 Redis
深入理解redis中multi与pipeline
Jun 02 Redis
Windows下redis下载、redis安装及使用教程
Jun 02 Redis
在redisCluster中模糊获取key方式
Jul 09 Redis
springboot使用Redis作缓存使用入门教程
Jul 25 Redis
Redis+Lua脚本实现计数器接口防刷功能(升级版)
Feb 12 Redis
解决linux下redis数据库overcommit_memory问题
Feb 24 Redis
在Centos 8.0中安装Redis服务器的教程详解
Mar 21 Redis
Redis中key的过期删除策略和内存淘汰机制
Apr 12 Redis
redis lua限流算法实现示例
Jul 15 Redis
python中使用redis用法详解
Dec 24 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实现多服务器共享SESSION数据的方法
2007/03/16 PHP
drupal 代码实现URL重写
2011/05/04 PHP
CodeIgniter框架过滤HTML危险代码
2014/06/12 PHP
swoole和websocket简单聊天室开发
2017/11/18 PHP
PHP实现APP微信支付的实例讲解
2018/02/10 PHP
php源码的使用方法讲解
2019/09/26 PHP
用javascript实现画板的代码
2007/09/05 Javascript
几种延迟加载JS代码的方法加快网页的访问速度
2013/10/12 Javascript
node.js中的events.emitter.once方法使用说明
2014/12/10 Javascript
JavaScript中判断两个字符串是否相等的方法
2015/07/07 Javascript
checkbox批量选中,获取选中项的值的简单实例
2016/06/28 Javascript
JavaScript 监控微信浏览器且自带返回按钮时间
2016/11/27 Javascript
巧用数组制作图片切换js代码
2016/11/29 Javascript
Html中 IFrame的用法及注意点
2016/12/22 Javascript
正则表达式基本语法及表单验证操作详解【基于JS】
2017/04/07 Javascript
js实现移动端轮播图效果
2020/12/09 Javascript
bootstrap table实现点击翻页功能 可记录上下页选中的行
2017/09/28 Javascript
Node.js中环境变量process.env的一些事详解
2017/10/26 Javascript
使用easyui从servlet传递json数据到前端页面的两种方法
2019/09/05 Javascript
javascript实现点击星星小游戏
2019/12/24 Javascript
Vue 实现拨打电话操作
2020/11/16 Javascript
python计算两个数的百分比方法
2018/06/29 Python
django 使用全局搜索功能的实例详解
2019/07/18 Python
使用python制作一个解压缩软件
2019/11/13 Python
如何基于python实现年会抽奖工具
2020/10/20 Python
HTML5实现表单自动验证功能实例代码
2017/01/11 HTML / CSS
美国益智玩具购物网站:Fat Brain Toys
2017/11/03 全球购物
环保倡议书怎么写
2014/05/16 职场文书
优秀应届毕业生自荐书
2014/06/29 职场文书
教师个人年度总结
2015/02/11 职场文书
自主招生自荐信怎么写
2015/03/24 职场文书
2015医院个人工作总结范文
2015/05/21 职场文书
让世界充满爱观后感
2015/06/10 职场文书
无房证明样本
2015/06/17 职场文书
如何在Python中创建二叉树
2021/03/30 Python
Win7/8.1用户可以免费升级到Windows 11系统吗?
2021/11/21 数码科技