Having problems with replication between leader and followers

Hi,
I’m running a cluster with 3 members. The followers joined in the cluster after the leader.

when i was caculating number of services using http://localhost:8500/v1/agent/services , the leader showed 10000+,but the followers showed only 3000+. Some services could be found on leader,but couldn’t be found on followers.

The version is Consul v1.7.3. Please give me a hand.

Thanks .

@horace_he,

Welcome to the forum!

/agent/services endpoint interact with services that are registered through the local agent in Consul. So in your case, you must have registered 10000+ services on the leader node and only 3000+ on the followers.

If you are looking for all the services, you should query the catalog API - Catalog - HTTP API | Consul by HashiCorp

thanks. Query /v1/catalog/services shows 3000+ services on each node , which is matched with output of “consul catalog services |wc -l” . I’m just wondering how came 10000+ services registered on leader node。Is there some historical records leaving on leader node ?