我使用阿里云服务器搭建了xxl的执行节点,但是一直在刷屏错误日志
2021-06-23 20:59:54.015 [ERROR] 1 --- [ntLoopGroup-3-7] j.c.s.EmbedServer$EmbedHttpServerHandler : >>>>>>>>>>> xxl-job provider netty_http server caught exception
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1134)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:745)
一开始是以为xxl引用netty版本冲突,因为redis里面也引用了netty,后来强制引用一致的netty版本,发现还是不能解决,最终找到了问题:我们使用的是阿里云搭建的服务,也是用阿里云的slb开通服务访问,负载均衡默认会开启安全检查,就是不断的去ping你的接口,这样调一次报一次错,所以只需要把你的负载均衡安全检查关闭就好了
如下图,把执行节点监听的端口的健康检查关闭掉就解决了