hashicorp / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
28.31k stars 4.42k forks source link

the service can be found through'/catalog/service/', but the service is still called 503 #11308

Open mrssz opened 3 years ago

mrssz commented 3 years ago

Problem Description: After our service is started, it can be accessed in the form of ip:port, and the service can also be found from consul through'/catalog/service/', but it will last for a period of time when called by the load balancing client 503.

I would like to ask which API can accurately determine whether the service is available, or what other methods can accurately determine whether the service is already available.

blake commented 3 years ago

Hi @mrssz, The health API endpoints can be used to only return services with health checks that are in a passing state.

Check out https://learn.hashicorp.com/tutorials/consul/service-registration-health-checks?in=consul/developer-discovery for a tutorial on configuring health checks for services.