weibocom / motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Other
5.9k stars 1.78k forks source link

整合opentracing后报错 #386

Open shenzhuan opened 7 years ago

shenzhuan commented 7 years ago

com.weibo.api.motan.exception.MotanServiceException: error_message: RoundRobinLoadBalance No available referers for call : referers_size= 0 requestId=1562077998622965761 interface=com.zs.pig.blog.api.service.BlogTypeService method=select(com.zs.pig.common.base.BaseEntity), status: 503, error_code: 10001,r=null at com.weibo.api.motan.cluster.loadbalance.AbstractLoadBalance.selectToHolder(AbstractLoadBalance.java:71) ~[AbstractLoadBalance.class:na] at com.weibo.api.motan.cluster.ha.FailoverHaStrategy.selectReferers(FailoverHaStrategy.java:90) ~[FailoverHaStrategy.class:na] at com.weibo.api.motan.cluster.ha.FailoverHaStrategy.call(FailoverHaStrategy.java:53) ~[FailoverHaStrategy.class:na] at com.weibo.api.motan.cluster.support.ClusterSpi.call(ClusterSpi.java:73) ~[ClusterSpi.class:na] at com.weibo.api.motan.proxy.RefererInvocationHandler.invoke(RefererInvocationHandler.java:125) ~[RefererInvocationHandler.class:na] at com.sun.proxy.$Proxy44.select(Unknown Source) [na:na] at com.zs.pig.common.beetl.function.BlogFunction.getAllType(BlogFunction.java:38) [BlogFunction.class:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111] at org.beetl.core.om.ObjectUtil.invoke(ObjectUtil.java:552) [ObjectUtil.class:na] at org.beetl.core.om.ObjectUtil.invoke(ObjectUtil.java:508) [ObjectUtil.class:na] at org.beetl.core.om.ObjectUtil.invokeObject(ObjectUtil.java:533) [ObjectUtil.class:na] at org.beetl.core.fun.SingleFunctionWrapper.call(SingleFunctionWrapper.java:65) [SingleFunctionWrapper.class:na] at org.beetl.core.statement.FunctionExpression.evaluate(FunctionExpression.java:76) [FunctionExpression.class:na] at org.beetl.core.statement.VarAssignStatement.execute(VarAssignStatement.java:52) [VarAssignStatement.class:na] at org.beetl.core.statement.VarAssignStatementSeq.execute(VarAssignStatementSeq.java:53) [VarAssignStatementSeq.class:na] at org.beetl.core.statement.Program.execute(Program.java:70) [Program.class:na] at org.beetl.core.engine.FilterProgram.execute(FilterProgram.java:31) [FilterProgram.class:na] at org.beetl.core.Template.renderTo(Template.java:137) [Template.class:na] at org.beetl.core.Template.renderTo(Template.java:90) [Template.class:na] at org.beetl.ext.web.WebRender.render(WebRender.java:125) [WebRender.class:na] at org.beetl.ext.spring.BeetlSpringView.renderMergedTemplateModel(BeetlSpringView.java:123) [BeetlSpringView.class:na] at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167) [AbstractTemplateView.class:4.1.4.RELEASE] at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) [AbstractView.class:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228) [DispatcherServlet.class:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011) [DispatcherServlet.class:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955) [DispatcherServlet.class:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) [DispatcherServlet.class:4.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) [FrameworkServlet.class:4.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) [FrameworkServlet.class:4.1.4.RELEASE]

shenzhuan commented 7 years ago

这是提供者没有找到的错误吧, 但是我的提供者启动是成功的啊 2017-02-54 10:02:54 INFO - RequestRouter addProvider: url=motan://192.168.56.1:8003/com.zs.pig.cms.api.service.ProductService?group=motan-cms-rpc all_public_method_count=172 2017-02-54 10:02:54 INFO - NettyEndpointFactory create share_channel server: url=motan://192.168.56.1:8003/com.zs.pig.cms.api.service.ProductService?group=motan-cms-rpc 2017-02-54 10:02:54 WARN - NettyServer ServerChannel already Open: url=motan://192.168.56.1:8003/?group=motan-cms-rpc 2017-02-54 10:02:54 INFO - DefaultRpcExporter node init Success: [DefaultRpcExporter] url=motan://192.168.56.1:8003/com.zs.pig.cms.api.service.ProductService?group=motan-cms-rpc 2017-02-54 10:02:54 INFO - DefaultRpcProtocol export Success: url=motan://192.168.56.1:8003/com.zs.pig.cms.api.service.ProductService?group=motan-cms-rpc 2017-02-54 10:02:54 INFO - [ZookeeperRegistry] Url (motan://192.168.56.1:8003/com.zs.pig.cms.api.service.ProductService?group=motan-cms-rpc) will register to Registry [zookeeper://127.0.0.1:2181/default_rpc/com.weibo.api.motan.registry.RegistryService/1.0/service] 2017-02-54 10:02:54 INFO - add method sign:savebcc12f5cb33e, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=saveproductType, paramtersDesc=com.zs.pig.cms.api.model.ProductType, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:delede730c8f416e, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=deleteProductType, paramtersDesc=com.zs.pig.cms.api.model.ProductType, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:dele6aeaa86c6ff2, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=delete, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:save40cbf5346641, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=save, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:insea7a8b0ae8dad, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=insert, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:befo4237d23c7e3b, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=beforeDelete, paramtersDesc=java.lang.Class,java.util.Map, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:inse45c203b7cb49, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=insertSelective, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:sele10b7119a69ca, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=selectOne, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:seleed806c952d92, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=selectPage, paramtersDesc=int,int,com.zs.pig.common.base.BaseEntity,java.lang.String, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:seled2bb2d314564, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=selectPage, paramtersDesc=int,int,com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:sele20f33f0b1e25, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=selectCount, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:seleafc329aa7098, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=select, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:seleef07801e135a, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=select, paramtersDesc=com.zs.pig.common.base.BaseEntity,java.lang.String, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:selefb5f6b9116d0, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=selectByPrimaryKey, paramtersDesc=java.lang.Object, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:delebd950fd9f3cb, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=deleteByPrimaryKey, paramtersDesc=java.lang.Object, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:updaacbb42368085, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=updateByPrimaryKey, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:upda449e61342869, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=updateByPrimaryKeySelective, paramtersDesc=com.zs.pig.common.base.BaseEntity, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:updad3834d58e1fa, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=updateDelFlagToDelStatusById, paramtersDesc=java.lang.Class,java.lang.Long, version=1.0] 2017-02-54 10:02:54 INFO - add method sign:befo25d4941f8f0a, methodinfo:MethodInfo [group=motan-cms-rpc, interfaceName=com.zs.pig.cms.api.service.ProductTypeService, methodName=beforeDeleteTreeStructure, paramtersDesc=java.lang.Object,java.lang.String,java.lang.Class[], version=1.0] 2017-02-54 10:02:54 INFO - RequestRouter addProvider: url=motan://192.168.56.1:8003/com.zs.pig.cms.api.service.ProductTypeService?group=motan-cms-rpc all_public_method_count=191 2017-02-54 10:02:54 INFO - NettyEndpointFactory create share_channel server: url=motan://192.168.56.1:8003/com.zs.pig.cms.api.service.ProductTypeService?group=motan-cms-rpc

rayzhang0603 commented 7 years ago

从报错看,client没有从注册中心获取到server节点信息。可以按以下步骤确认: 1、server端的提供服务开关是否打开了。

MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true);

2、确认server是否在注册中心注册成功了。 可以通过管理后台查询server是否为working状态。 或者在注册中心上查看是否有对应服务节点。例如使用zk作为注册中心,在zk上/motan/${your group}/${interface}/server/下有没有对应节点

shenzhuan commented 7 years ago

MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true); 加了这个就好了,但是为什么我以前是不用加的

rayzhang0603 commented 7 years ago

估计以前是配置了directUrl了吧