dubbo 中provider调用超时

异常如下:"Failed to invoke the method doSaveCityMonthData in the service com.gefang.provider.dapa.service.IAppUsedService. Tried 3 times of the providers [192.168.195.1:8085] (1/1) from the registry 192.168.0.210:8082 on the consumer 192.168.195.1 using the dubbo version 2.5.7. Last error is: Invoke remote method timeout. method: doSaveCityMonthData, provider: dubbo://192.168.195.1:8085/com.gefang.provider.dapa.service.IAppUsedService?anyhost=true&application=consumer-dapa&check=false&dubbo=2.5.7&generic=false&interface=com.gefang.provider.dapa.service.IAppUsedService&methods=saveAppUsedInfoProjectOriginalMonth,getUnComputeCityMonthData,getAztaskAppUsedInfo,updateAppUsedInfoProjectMonth,getAztaksAppUsedInfoSub,saveAppUsedInfoProjectMonth,getProjectSubUsedInfoMonth,getAppUsedInfo,setCityMonthCompute,getLastestCityMonthData,getUnComputeProjectData,doSaveCityMonthData,doSaveAzTaskAppUsedInfoCity,setProjectMonthCompute,getProjectUsedInfoMonth,saveAppUsedInfoCityMonth,saveAzTaskAppUsedInfoCity&pid=4296®ister.ip=192.168.195.1&remote.timestamp=1515388768873&revision=1.0.0-SNAPSHOT&side=consumer&timeout=6000×tamp=1515389242018, cause: Waiting server-side response timeout. start time: 2018-01-08 13:27:54.973, end time: 2018-01-08 13:28:00.980, client elapsed: 5 ms, server elapsed: 6002 ms, timeout: 6000 ms, request: Request [id=2, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=doSaveCityMonthData, parameterTypes=[class java.lang.String], arguments=[201712], attachments={path=com.gefang.provider.dapa.service.IAppUsedService, interface=com.gefang.provider.dapa.service.IAppUsedService, version=0.0.0, timeout=6000}]], channel: /192.168.195.1:54113 -> /192.168.195.1:8085"


分布式菜鸟,刚遇见这个问题时,一瞅是timeout,而且有  Tried 3 times of the providers 完全不知道啥回事,秉着不懂就百度。异常就打log的处理问题方式。找到了原因。 provider在调用方法时,有个超时设置(针对每个Service),如果超时,那么会重新发起,会这样搞三次。如果第三次还是超时,那么就会跳出异常。将对应异常的service的时间调长一些。这个设置一般是在provider.xml暴露zookeeper注册中心这里进行设置的。

<dubbo:service interface="AdService" ref="adService" timeout="6000"/>

将timeout调大一点,如果不考虑其他,直接加上两 00 。十分钟。够了的。ok,解决问题


你可能感兴趣的:(经验,学习)