How to deploy an ElasticSearch cluster using CoreOS and Consul
The hot potato in the room of Containerized solutions is persistent services. Stateless applications are easy and trivial, but to deploy a persistent services like ElasticSearch is a totally different ball game. In this blog post we will show you how easy it is on this platform to create ElasticSearch clusters. The key to the easiness is the ability to lookup external ip addresses and port numbers of all cluster members in Consul and the reusable power of the CoreOS unit file templates. The presented solution is a ready-to-use ElasticSearch component for your application.
This solution:
- uses empheral ports so that we can actually run multiple ElasticSearch nodes on the same host
- mounts persistent storage under each node to prevent data loss on server crashes
- uses the power of the CoreOS unit template files to deploy new ElasticSearch clusters.