我是靠谱客的博主 传统保温杯,最近开发中收集的这篇文章主要介绍io.netty.channel.ConnectTimeoutException: connection timed outidea整合redis报错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(第四行,第三单词)表示防火墙已经关闭

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

最后

以上就是传统保温杯为你收集整理的io.netty.channel.ConnectTimeoutException: connection timed outidea整合redis报错io.netty.channel.ConnectTimeoutException: connection timed out的全部内容,希望文章能够帮你解决io.netty.channel.ConnectTimeoutException: connection timed outidea整合redis报错io.netty.channel.ConnectTimeoutException: connection timed out所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(42)

评论列表共有 0 条评论

立即
投稿
返回
顶部