How it works...

Once the command has executed successfully the Consul agent starts running in server mode, giving us the following output:

We can also list the members of the Consul cluster by executing the following command:

$ consul members

This will give us the following result:

Because Consul can be run either in server or client mode with at least one server, to keep the setup at a bare minimum we have started our agent in server mode, though it is not recommended because there are chances of data loss in a failure scenario.

Moreover, ...

Get Go Web Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.