io.netty.channel.ConnectTimeoutException: connection timed out

idea整合redis报错io.netty.channel.ConnectTimeoutException: connection timed out

原因分析:
这个问题有很大的可能是Linux的防火墙未关闭,请求无法到达redis客户端。

如果想要外部访问redis前提是把redis配置文件中的 protected-mode yes,改为 protected-mode no 这样redis才允许外部访问

1.使用命令查看防火墙是否关闭

查看Linux防火墙状态命令:systemctl status firewalld.service

[root@iZwz95p6ra1evt2xcc42ymZ bin]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-04-21 01:13:20 CST; 1 weeks 3 days ago
     Docs: man:firewalld(1)
 Main PID: 1472 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─1472 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

Apr 21 01:13:19 iZwz95p6ra1evt2xcc42ymZ systemd[1]: Starting firewalld - dynamic firewall daemon...
Apr 21 01:13:20 iZwz95p6ra1evt2xcc42ymZ systemd[1]: Started firewalld - dynamic firewall daemon.
Apr 21 01:13:20 iZwz95p6ra1evt2xcc42ymZ firewalld[1472]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in...ng it now.
Hint: Some lines were ellipsized, use -l to show in full.

如上出现running(第四行,第三单词)表示防火墙未关闭

2.使用命令关闭防火强:systemctl stop firewalld.service

再次查看Linux防火墙状态命令:systemctl status firewalld.service
会发现变成这样

[root@iZwz95p6ra1evt2xcc42ymZ bin]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

Apr 21 01:13:19 iZwz95p6ra1evt2xcc42ymZ systemd[1]: Starting firewalld - dynamic firewall daemon...
Apr 21 01:13:20 iZwz95p6ra1evt2xcc42ymZ systemd[1]: Started firewalld - dynamic firewall daemon.
Apr 21 01:13:20 iZwz95p6ra1evt2xcc42ymZ firewalld[1472]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in...ng it now.
May 01 17:25:37 iZwz95p6ra1evt2xcc42ymZ systemd[1]: Stopping firewalld - dynamic firewall daemon...
May 01 17:25:37 iZwz95p6ra1evt2xcc42ymZ systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.

如上出现dead(第四行,第三单词)表示防火墙已经关闭

再次尝试访问就不会报错了噢

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李济号

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值