xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.47k stars 10.86k forks source link

2.1.1容器环境手动调度可以,自动调度报错。 #1303

Closed An0nymous0 closed 4 years ago

An0nymous0 commented 4 years ago

Please answer some questions before submitting your issue. Thanks!

Which version of XXL-JOB do you using?

2.1.0升级到2.1.1

Expected behavior

成功

Actual behavior

触发调度: address:172.17.0.3:9999 code:500 msg:com.xxl.rpc.util.XxlRpcException: io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: No route to host: /172.17.0.3:9999 at com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean$1.invoke(XxlRpcReferenceBean.java:227) at com.sun.proxy.$Proxy78.run(Unknown Source) at com.xxl.job.admin.core.trigger.XxlJobTrigger.runExecutor(XxlJobTrigger.java:196) at com.xxl.job.admin.core.trigger.XxlJobTrigger.processTrigger(XxlJobTrigger.java:149) at com.xxl.job.admin.core.trigger.XxlJobTrigger.trigger(XxlJobTrigger.java:74) at com.xxl.job.admin.core.thread.JobTriggerPoolHelper$3.run(JobTriggerPoolHelper.java:76) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: No route to host: /172.17.0.3:9999 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) at io.netty.channel.socket.

Steps to reproduce the behavior

部署在容器里。 自动定时调度就报错。 手动执行就没问题。

Other information

调度器和执行器都在docker里,回滚到2.1.0就没这个问题了

截图是调度器连执行器 image image

结果日志 ` 任务触发类型:手动触发
调度机器:172.17.0.2
执行器-注册方式:手动录入
执行器-地址列表:[172.17.0.4:9999, 172.17.0.5:9999]
路由策略:第一个
阻塞处理策略:单机串行
任务超时时间:0
失败重试次数:0

>>>>>>>>>>>触发调度<<<<<<<<<<<
触发调度:
address:172.17.0.4:9999
code:200
msg:null


任务触发类型:Cron触发
调度机器:172.17.0.2
执行器-注册方式:手动录入
执行器-地址列表:[172.17.0.4:9999, 172.17.0.5:9999]
路由策略:第一个
阻塞处理策略:单机串行
任务超时时间:0
失败重试次数:0

>>>>>>>>>>>触发调度<<<<<<<<<<<
触发调度:
address:172.17.0.4:9999
code:500
msg:com.xxl.rpc.util.XxlRpcException: io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: No route to host: /172.17.0.4:9999 at com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean$1.invoke(XxlRpcReferenceBean.java:227) at com.sun.proxy.$Proxy78.run(Unknown Source) at com.xxl.job.admin.core.trigger.XxlJobTrigger.runExecutor(XxlJobTrigger.java:196) at com.xxl.job.admin.core.trigger.XxlJobTrigger.processTrigger(XxlJobTrigger.java:149) at com.xxl.job.admin.core.trigger.XxlJobTrigger.trigger(XxlJobTrigger.java:74) at com.xxl.job.admin.core.thread.JobTriggerPoolHelper$3.run(JobTriggerPoolHelper.java:76) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: No route to host: /172.17.0.4:9999 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:670) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ... 1 more Caused by: java.net.NoRouteToHostException: No route to host ... 12 more `

An0nymous0 commented 4 years ago

@xuxueli help me

xuxueli commented 4 years ago

你好,首先确定调度中心与执行器版本保持一致。重新编译部署下。 这个问题无法复现,No Host问题可以参考这个文档:https://blog.csdn.net/KgdYsg/article/details/84567564

An0nymous0 commented 4 years ago

@xuxueli

前提调度器和执行器都是docker环境。注册时是docker内ip

版本是一致的,不然都注册不上。

防火墙的问题看过了,再有容器环境都没装iptables。 网络环境也自测了。 可是为什么手动触发可以通,自动cron就报错呢。 如果真的是防火墙或者网络环境问题。 都通不了吧,简单看了下源码好像最终的方法走的是同一个。很费解手动和自动有啥区别。

因为我是从2.1.0升级到2.1.1的。 原有2.1.0环境没有变只是升级下包,就这样的了。

fly7632785 commented 2 years ago

你好这边 admin 和 执行器 都是2.3.0
然后执行器应用在docker里面,但是使用的host网络,非bridge。自动注册的还是 docker容器的ip @xuxueli