当 consul 节点 运行 处于服务器模式时,哪个端点 /v1/agent/services 将 return?

when consul node run on server mode, what endpoint /v1/agent/services will return?

我发现我的服务器节点的端点 >/v1/agent/services returns 大多数服务,但不是所有服务,有人知道为什么吗?

服务的可见性将取决于您使用的 API 端点。

Consul 打算针对 Consul 客户端代理注册服务,该客户端代理 运行 在与已部署服务相同的主机上(使用 /v1/agent/service/register endpoint). The services registered with each agent in the data center are aggregated to form the service catalog (https://www.consul.io/docs/architecture/anti-entropy#catalog)。

/v1/agent/services endpoint only returns services which have been registered against the specific agent with which you are communicating. In contrast, the /v1/catalog/services 端点returns 已在数据中心的每个代理注册的所有服务的聚合列表。如果查询此端点,您将收到向 Consul 注册的所有服务的列表。