O'Reilly logo

Native Docker Clustering with Swarm by Chanwit Kaewkasi, Fabrizio Soppelsa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting services: A WordPress example

The possibility of launching a bunch of replicated and load balanced containers is already a good start, but how about more complex application stacks, made of different interconnected containers?

In this case, you can link containers by calling them by name. As we just saw, the internal Swarm DNS server will guarantee a reliable name resolution mechanism. If you instantiate a service called nginx, you can just reference it as nginx and other services will resolve to the nginx Virtual IP (load balanced), hence accessing the distributed containers.

To demonstrate this with an example, we're now going to deploy the more classical of classics on Swarm: WordPress. You can run WordPress as a container, in fact ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required