英文:
"rpc error: code = Unavailable desc = closing transport due to: connection error"
问题
我正在使用k8来托管我的grpc服务。
有时候,在我的请求进行了几毫秒后,我会遇到以下错误:
rpc error: code = Unavailable desc = closing transport due to: connection error: desc = "error reading from server: read tcp <ipaddr>:52220-><internal ip addr>:8070: read: connection reset by peer", received prior goaway: code: NO_ERROR
我想问一下,这是怎么发生的?可能是k8的网络出了问题吗?
英文:
I am using k8 to host my grpc service.
Sometimes, I am getting the following error (few milliseconds into my request):
rpc error: code = Unavailable desc = closing transport due to: connection error: desc = "error reading from server: read tcp <ipaddr>:52220-><internal ip addr>:8070: read: connection reset by peer", received prior goaway: code: NO_ERROR
May I ask how will this occur? Could it be that the k8's network is down?
答案1
得分: 2
这是因为在服务器关闭时,它会发送一个初始的GOAWAY来支持优雅关闭。这意味着你的服务器已经关闭了。
英文:
This happened because on server shutdown, it sends an initial GOAWAY to support graceful shutdown. This means your server shut down.
答案2
得分: 0
在我的情况下,我使用OpenShift进行部署。在本地环境中一切都很好。
我有用于不同环境的yaml文件,比如
development.yaml, staging.yaml, production.yaml
在developent.yaml
中,我使用localhost来连接微服务,即
auth_service_url: localhost:50051
在部署之前,我没有注意到这一点,因此导致了那个错误。
我只需将微服务的URL更新为指向**OpenShift服务名称
**
auth_service_url: np-auth-service:50051 //其中np-auth-service是我OpenShift环境中的服务名称。
英文:
In my case I was using openshift for deployment. Everything was fine in local environment.
I have my yaml file for diff environments like
development.yaml, staging.yaml, production.yaml
In developent.yaml
I used localhost to connect to microservices, i.e
auth_service_url: localhost:50051
And I didn't notice this before deployment and hence resulting in that error.
I just updated microservice url to point to openshift service name
auth_service_url: np-auth-service:50051 //where np-auth-service is a service name in my openshift environment.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论