When using the microservice approach to applications, you end up with a lot of servers listening on a variety of IPs, domains, and ports. These IP addresses will vary by environment (staging versus production), and it can be tricky to keep them static for configuration between services. You also want to know when a machine or service is down or unreachable due to a network partition. Consul is a tool that provides a lot of functionality, but we'll explore registering services with Consul and querying them from our other services.
Using service discovery with Consul
Getting ready
Configure your environment according to these steps:
- Download and install Go on your operating system from https://golang.org/doc/install and...