zookeeper+dubbo实现分布式服务调用,提供者关闭后重新注册,消费者一定要重启吗?

看见一座山 发布于 2017/08/16 16:19
阅读 5K+
收藏 1

阿里云2020上云采购季,爆款产品,低至0.6折,点击抢购!>>>

提供者关闭重启,消费者不重启,就会down,怎么解啊 

 

2017-08-16 16:18:36.790 [DubboClientReconnectTimer-thread-1|] WARN  o.j.n.channel.DefaultChannelPipeline- [DUBBO] An exception was thrown by an exception handler., dubbo version: 2.8.4x-SNAPSHOT, current host: 192.168.6.222
java.util.concurrent.RejectedExecutionException: Worker has already been shutdown
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.registerTask(AbstractNioSelector.java:120)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:72)
    at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:36)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:56)
    at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:36)
    at org.jboss.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:34)
    at org.jboss.netty.channel.DefaultChannelPipeline.execute(DefaultChannelPipeline.java:636)
    at org.jboss.netty.channel.Channels.fireExceptionCaughtLater(Channels.java:496)
    at org.jboss.netty.channel.AbstractChannelSink.exceptionCaught(AbstractChannelSink.java:46)
    at org.jboss.netty.channel.DefaultChannelPipeline.notifyHandlerException(DefaultChannelPipeline.java:658)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:781)
    at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:54)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784)
    at org.jboss.netty.channel.SimpleChannelHandler.closeRequested(SimpleChannelHandler.java:334)
    at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:260)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
    at org.jboss.netty.channel.Channels.close(Channels.java:812)
    at org.jboss.netty.channel.AbstractChannel.close(AbstractChannel.java:197)
    at org.jboss.netty.channel.ChannelFutureListener$2.operationComplete(ChannelFutureListener.java:52)
    at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:431)
    at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:417)
    at org.jboss.netty.channel.DefaultChannelFuture.setFailure(DefaultChannelFuture.java:384)
    at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:130)
    at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:779)
    at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:54)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784)
    at org.jboss.netty.channel.SimpleChannelHandler.connectRequested(SimpleChannelHandler.java:306)
    at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:272)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
    at org.jboss.netty.channel.Channels.connect(Channels.java:634)
    at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:207)
    at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:229)
    at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:182)
    at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:94)
    at com.alibaba.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:285)
    at com.alibaba.dubbo.remoting.transport.AbstractClient$1.run(AbstractClient.java:150)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

加载中
0
看见一座山
看见一座山

对应的duboo中的源码:    com.alibaba.dubbo.common.Constants   DEFAULT_SESSION_TIMEOUT            = 60 * 1000; 这个时间配置了 检查时间是60秒  配长点就可以了

0
夜色霓虹灯
夜色霓虹灯

提供者不是多台服务吗?如果重启应该逐个重启吧。

看见一座山
看见一座山
我只配置了一台提供者啊
0
maradona
maradona

check="false" 试试

看见一座山
看见一座山
不行,这个用的应该蛮多啊 ,大神们都去哪了
0
nyyEgg
nyyEgg

你可以尝试一下, 两台服务者, 一台挂掉了, 直接重启应该没问题的

0
francis-x
francis-x

消费者不用。在提供者挂掉的时候,消费端访问提供者的服务会报错。

提供者重启后,只要提供者注册到zookeeper,并且提供者在重启前后的服务签名(方法名、参数、返回值)没有发生变化,客户端仍然可以正常访问提供者的服务。

0
X
Xavier_Ho

最后怎么解决的哇?我也遇到了

返回顶部
顶部