关于Redis的远程连接 Connection: Disconnect on error 问题

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介: 关于Redis的远程连接 Connection: Disconnect on error 问题

bug描述:


Connection: Disconnect on error: Connection error: Connection timed outConnection: 192.168.245.128 > connection failed



3782523abcde09fcb2dada0d8e298c6f_f6fcd3aab83c46cbb2d3cf3358c77f8d.png


问题复现:


redis版本: redis-6.2.6


Linux版本:CenterOS 7


在linux上已经完成了redis的安装,并修改了配置。

把bind 127.0.0.1 修改成bind 0.0.0.0 (目的:允许远程连接访问)

开启了守护进程 :把daemonize no 改为 daemonize yes 。

使用./redis-server redis.config 命令成功运行。

使用./redis-cli 命令成功进入客户端。

但使用客户单远程连接linux上的redis出现问题。


解决方案:

sudo systemctl stop firewalld.service #停止firewall


sudo systemctl disable firewalld.service #禁止firewall开机启动


在linux中使用代码关闭了防火墙。

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
17天前
|
NoSQL Unix 网络安全
【Azure Cache for Redis】Python Django-Redis连接Azure Redis服务遇上(104, 'Connection reset by peer')
【Azure Cache for Redis】Python Django-Redis连接Azure Redis服务遇上(104, 'Connection reset by peer')
【Azure Cache for Redis】Python Django-Redis连接Azure Redis服务遇上(104, 'Connection reset by peer')
|
17天前
|
缓存 NoSQL Redis
【Azure Redis 缓存】使用StackExchange.Redis,偶发ERROR - Timeout performing HSET (15000ms)
【Azure Redis 缓存】使用StackExchange.Redis,偶发ERROR - Timeout performing HSET (15000ms)
|
17天前
|
NoSQL 安全 网络安全
【Azure Redis】PHPRedis遇见SSL Connection Timeout问题
【Azure Redis】PHPRedis遇见SSL Connection Timeout问题
【Azure Redis】PHPRedis遇见SSL Connection Timeout问题
|
24天前
|
NoSQL 数据可视化 Linux
2022 年超详细步骤讲解 CentOS 7 安装Redis 。解决Redis Desktop Manager 图形化工具连接失败解决 ;connection failed处理。开机自启Redis
这篇文章提供了在CentOS 7上安装Redis的详细步骤,包括上传Redis安装包、解压安装、编译、安装、备份配置文件、修改配置以支持后台运行和设置密码、启动Redis服务、使用客户端连接Redis、关闭Redis服务、解决Redis Desktop Manager图形化工具连接失败的问题、设置Redis开机自启动,以及Redis服务的启动和停止命令。
2022 年超详细步骤讲解 CentOS 7 安装Redis 。解决Redis Desktop Manager 图形化工具连接失败解决 ;connection failed处理。开机自启Redis
|
17天前
|
NoSQL Linux 网络安全
【Azure Redis】Redis-CLI连接Redis 6380端口始终遇见 I/O Error
【Azure Redis】Redis-CLI连接Redis 6380端口始终遇见 I/O Error
|
17天前
|
缓存 NoSQL Linux
【Azure Redis 缓存】应用中出现连接Redis服务错误(production.ERROR: Connection refused)的排查步骤
【Azure Redis 缓存】应用中出现连接Redis服务错误(production.ERROR: Connection refused)的排查步骤
|
18天前
|
缓存 NoSQL 网络安全
【Azure Redis 缓存】 Python连接Azure Redis, 使用redis.ConnectionPool 出现 "ConnectionResetError: [Errno 104] Connection reset by peer"
【Azure Redis 缓存】 Python连接Azure Redis, 使用redis.ConnectionPool 出现 "ConnectionResetError: [Errno 104] Connection reset by peer"
|
18天前
|
缓存 NoSQL Java
【Azure Redis 缓存】云服务Worker Role中调用StackExchange.Redis,遇见莫名异常(RedisConnectionException: UnableToConnect on xxx 或 No connection is available to service this operation: xxx)
【Azure Redis 缓存】云服务Worker Role中调用StackExchange.Redis,遇见莫名异常(RedisConnectionException: UnableToConnect on xxx 或 No connection is available to service this operation: xxx)
|
20天前
|
缓存 NoSQL Java
【Azure Redis 缓存 Azure Cache For Redis】当使用Jedis客户端连接Redis时候,遇见JedisConnectionException: Could not get a resource from the pool / Redis connection los
【Azure Redis 缓存 Azure Cache For Redis】当使用Jedis客户端连接Redis时候,遇见JedisConnectionException: Could not get a resource from the pool / Redis connection los
|
4月前
|
NoSQL 网络安全 Redis
redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:6379. Connection refused.
当使用Python连接Redis遇到"ConnectionError: Error 111"时,可能的原因包括Redis未启动、非默认端口监听、防火墙阻拦、配置错误或Redis模块安装不正确。解决方法包括启动Redis、检查端口与防火墙设置、修正配置文件、确保模块正确安装及测试服务器功能。提供了一个Python连接Redis的示例代码,根据实际情况调整IP和端口,以诊断连接问题。
215 0