Closed johnyq closed 4 years ago
IIRC there is a slight difference between the dns
and the discovery
resolver. The first one connects to the k8s-service whereas the second one connects to the k8s-pods/the ips provided by the discovery service.
Have you tried "downloading" the resources-service
ips from your discovery and connect to them directly either using:
static://<ip:port>,...
(supports multiple) or dns:///<ip:port>
(supports only one)?
Then we can check whether it's an issue with the connection/network or the discovery-service/resolver.
Closed until required information are provided
I have a very strange problem when use the nacos as discovery server in the k8s environment.
all the service running in the k8s .client call the service , like this
@GrpcClient("resource-service")
and the application.properties configgrpc.client.resource-service.address=dns:///resources-service:9090
"resources-service" is k8s service name . this is ok.use nacos as service discovery server. remove grpc client target server property.All the services running, nacos dashboard display its at normal state,local test is working.
Deploy to the K8S ,call the resource-service failed. I check code and configuration and try more times and get the same result. when i recover dns configuration property, the code working. following logs
errorCode=8
At first I thought it was network error or grpc-java issue until I back to "grpc.client.....= dns:///" . I'm not sure what it is what's causing it
The application's environment spring boot 2.1.16.RELEASE spring cloud Greenwich.SR6 spring cloud alibaba 2.1.2.RELEASE grpc-spring-boot-start 2.10.1.RELEASE