Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nacos uses vip+nginx load balancing to cause a client to appear UNAVAILABLE: Network closed for unknown reason #12297

Closed
tanglinyan opened this issue Jun 27, 2024 · 6 comments

Comments

@tanglinyan
Copy link

Describe the bug
nacos uses vip+nginx load balancing to cause a client to appear UNAVAILABLE: Network closed for unknown reason
This works when accessing specific nacos nodes, but does not work when load balancing via nginx
Is nacos http service stateless, and if so, what about grpc

UNAVAILABLE: Network closed for unknown reason appears once every 3 seconds

hosts.conf
192.168.4.151 yanfa-nacos1
192.168.4.145 yanfa-nacos2
192.168.4.146 yanfa-nacos3

Desktop (please complete the following information):

  • OS: macos
  • Version nacos-server-2.3.2
  • SDK spring.cloud.alibaba.version:2023.0.1.0,dubbo:3.2.12

Additional context
image

image image
@KomachiSion
Copy link
Collaborator

It should be your nginx or vip will close the connection with an interval.

Please make sure your nginx and vip transport by tcp but not http and https. And make sure them will not reuse and redistribution connection with any dimensions.

I suggest you try to connect nacos server directly, if connect directly is ok. there must be some config problem in vip or nginx to close connection each 3 seconds.

@tanglinyan
Copy link
Author

It is normal to use VIP or connect to one nacos service
The above error occurs with nginx load balancing
My related configuration is provided above

@tanglinyan
Copy link
Author

I hope you can help me. This problem has been bothering me for a long time

@KomachiSion
Copy link
Collaborator

KomachiSion commented Jul 8, 2024

stream {

    upstream grpc_server {
       server 127.0.0.1:9848;
    }

    server {
        listen 9080 so_keepalive=on;
        proxy_responses 1;
        proxy_timeout 20s;
        proxy_pass grpc_server;

    }
}

I use this configuration in nginx work well. you can try it. If can't work well. I suggest you find out which configuration make the connection closed by nginx or vip by yourself.

@tanglinyan
Copy link
Author

Thank you very much. I'll try it your way.

@KomachiSion
Copy link
Collaborator

No more response from author for a long time, and this problem seems new version has solved this problem.

@KomachiSion KomachiSion closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants