consul-cache is a local cache disguised as consul agent and has stronger performance.
In the consul cluster, when the app initiates a watch request, the consul agent will forward the request to the consul server, which will put a huge burden on the consul server. The purpose of consul-cache is to separate this burden from the consul server.
consul-cache has 2 components.
Discover service changes from consul and build all instances corresponding to the service in Redis
cache disguises itself as a consul agent to facilitate service discovery by business programs
Switch to directory docker_compose
cd docker_compose
docker-compose up -d
docker-compose down
refer to this document
curl -X PUT --data @payload.json \
http://localhost:18550/v1/agent/service/register
curl 'http://localhost:18500/v1/health/service/web?dc=dc1&passing=true'