redis连接超时connection timed out: /192.168.60.130:6379
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.60.130:6379
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:150)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
... 1 more
1.查看linux机器是否能联网
ping www.baidu.com
2.查看linux的ip地址
ifconfig
以管理员身份打开windows命令行窗口,输入
ping 192.168.60.130
如果能ping通说明网络没问题 查看端口号是否能通
telnet 192.168.60.130 6379
如果成功则会弹出一个命令行窗口,如果不能成功,则可能是linux防火墙的问题(我的是这个原因)
如果是inux防火墙的问题,一下是解决方案:
查看linux版本
cat /etc/redhat-release
关闭防火墙 (CentOS6) #临时关闭防火墙 servcie iptables stop
#永久关闭防火墙(我的是CentOS6.8,用的这个命令) chkconfig iptables off
(CentOS 7) #关闭防火墙(CentOS 7) sudo systemctl stop firewalld.service
|