[apache/dubbo]3.1.0集成istio后,调用报错 UNAVAILABLE : upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: delayed

2024-06-24 167 views
0
  • Dubbo version: 3.1.0
  • Operating System version: linux
  • Java version: 1.8

使用nacos注册中心,在接入k8s并集成istio后,由消费端调用提供者,提示报错如下:


SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.dubbo.rpc.RpcException: Failed to invoke the method getEmpInfo in the service cn.com.bluemoon.istio.demo.dubbo.service.CustEmpService. Tried 3 times of the providers [istio-demo-dubbo-producer.istio-demo.svc.cluster.local:20885] (1/1) from the registry istio-demo-dubbo-producer.istio-demo.svc.cluster.local:20885 on the consumer 10.233.78.134 using the dubbo version 3.1.0. Last error is: Fail to invoke remote method: getEmpInfo, provider: tri://istio-demo-dubbo-producer.istio-demo.svc.cluster.local:20885/cn.com.bluemoon.istio.demo.dubbo.service.CustEmpService?application=istio-demo-consumer&background=false&check=false&interface=cn.com.bluemoon.istio.demo.dubbo.service.CustEmpService&lazy=true&mesh-enable=true&pid=11&provided-by=istio-demo-dubbo-producer&provider-port=20885&qos.accept.foreign.ip=true&qos.enable=false&register-mode=instance&register.ip=10.233.78.134&revision=1.0-SNAPSHOT&side=consumer&sticky=false, cause: org.apache.dubbo.rpc.StatusRpcException: UNAVAILABLE : upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: delayed connect error: 111
--
2022-09-09 14:28:52 | RemoteAddress:istio-demo-dubbo-producer.istio-demo.svc.cluster.local:20885] with root cause

回答

5

这个看起来是使用 proxy 模式的?走的 envoy 透明拦截的模式?

2

是的,使用proxy模式,走的 envoy 透明拦截的模式;

dubbo配置的 dubbo.dubbo.protocol.port = 20885, dubbo.application.metadataServicePort = 20880

  • 提供者pod里面 telnet localhost 没问题,但是 telnet k8s 暴露的dns就不通 1663038619967

  • 消费端, 不管是telnet 提供者ip还是 k8s dns都不通

image

1

这个看起来是 envoy 拦截导致问题,Dubbo 绑定端口的时候默认是使用 AnyHost 0.0.0.0 的

7

对于有需要对dubbo服务做 AB、蓝绿的需求,官方这边有实际的案例可以参考下吗

8

现在到这一步就进行不下去了,服务端和消费端无法通信;报错信息就如标题所示

image

0

用的示例的项目部署的?

6

不是,参照示例改的。注册中心用的是nacos

5

修改后的示例可以发一下吗,包括具体的部署方式

9

问题解决了。服务名没有跟k8s service名字一致导致在开启mesh的时候,一直提示没有提供者。感谢答疑!