Silocean commented on issue #11789:
URL: https://github.com/apache/dubbo/issues/11789#issuecomment-1469458221

   之前测试使用的路由配置host有问题,没有加namespace,所以路由功能没有生效,按照下面的配置修改后又重新做了测试:
   ```
   apiVersion: networking.istio.io/v1alpha3
   kind: VirtualService
   metadata:
     name: dubbo-xds-test-vs
     namespace: dubbo-demo
   spec:
     hosts:
       - dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local
     http:
       - route:
           - destination:
               host: dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local
               subset: v1
               port:
                 number: 50051
             weight: 50
           - destination:
               host: dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local
               subset: v2
               port:
                 number: 50051
             weight: 50
   ---
   apiVersion: networking.istio.io/v1alpha3
   kind: DestinationRule
   metadata:
     name: dubbo-xds-test-dr
     namespace: dubbo-demo
   spec:
     host: dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local
     trafficPolicy:
       loadBalancer:
         # Envoy load balancing strategy
         simple: ROUND_ROBIN
     subsets:
       - name: v1
         labels:
           version: v1
       - name: v2
         labels:
           version: v2
   ```
   调用provider直接失败,报错信息如下:
   ```
   WARNING:  [DUBBO] No provider available after route for the service 
org.apache.dubbo.samples.api.GreetingService:1.0.0 from registry 10.244.0.252 
on the consumer 10.244.0.252 using the dubbo version 1.0-SNAPSHOT. Router 
snapshot is below: 
   [ Parent (Input: 0) (Current Node Output: 0) (Chain Node Output: 0) ] Input: 
Empty -> Chain Node Output: Empty
     [ MockInvokersSelector (Input: 0) (Current Node Output: 0) (Chain Node 
Output: 0) Router message: Empty invokers. Directly return. ] Current Node 
Output: Empty, dubbo version: 1.0-SNAPSHOT, current host: 10.244.0.252, error 
code: 2-2. This may be caused by No provider available after route for the 
service, go to https://dubbo.apache.org/faq/2/2 to find instructions. 
   Mar 15, 2023 6:59:21 AM 
org.apache.dubbo.rpc.cluster.directory.AbstractDirectory warn
   WARNING:  [DUBBO] No provider available after connectivity filter for the 
service org.apache.dubbo.samples.api.GreetingService:1.0.0 All validInvokers' 
size: 0 All routed invokers' size: 0 All invokers' size: 0 from registry 
istiod.istio-system.svc:15012 on the consumer 10.244.0.252 using the dubbo 
version 1.0-SNAPSHOT., dubbo version: 1.0-SNAPSHOT, current host: 10.244.0.252, 
error code: 2-2. This may be caused by provider server or registry center 
crashed, go to https://dubbo.apache.org/faq/2/2 to find instructions. 
   org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in 
the service org.apache.dubbo.samples.api.GreetingService. No provider available 
for the service org.apache.dubbo.samples.api.GreetingService:1.0.0 from 
registry istiod.istio-system.svc:15012 on the consumer 10.244.0.252 using the 
dubbo version 1.0-SNAPSHOT. Please check if the providers have been started and 
registered.
    at 
org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:367)
    at 
org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:60)
    at 
org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:341)
    at 
org.apache.dubbo.rpc.cluster.router.RouterSnapshotFilter.invoke(RouterSnapshotFilter.java:46)
    at 
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
    at 
org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:101)
    at 
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
    at 
org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:52)
    at 
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
    at 
org.apache.dubbo.spring.security.filter.ContextHolderParametersSelectedTransferFilter.invoke(ContextHolderParametersSelectedTransferFilter.java:41)
    at 
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
    at 
org.apache.dubbo.rpc.cluster.filter.support.ConsumerClassLoaderFilter.invoke(ConsumerClassLoaderFilter.java:40)
    at 
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
    at 
org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:118)
    at 
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
    at 
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.invoke(FilterChainBuilder.java:194)
    at 
org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:92)
    at 
org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:103)
    at 
org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:282)
    at org.apache.dubbo.rpc.proxy.InvocationUtil.invoke(InvocationUtil.java:56)
    at 
org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:75)
    at 
org.apache.dubbo.samples.api.GreetingServiceDubboProxy0.sayHello(GreetingServiceDubboProxy0.java)
    at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
    at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
    at com.sun.proxy.$Proxy27.sayHello(Unknown Source)
    at 
org.apache.dubbo.samples.action.GreetingServiceConsumer.doSayHello(GreetingServiceConsumer.java:34)
    at 
org.apache.dubbo.samples.ConsumerBootstrap.main(ConsumerBootstrap.java:38)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to