Strategy to persist the node's data for dynamic Elasticsearch clusters

I’m sorry that this is probably a kind of broad question, but I didn’t find a solution form this problem yet.

I try to run an Elasticsearch cluster on Mesos through Marathon with Docker containers. Therefore, I built a Docker image that can start on Marathon and dynamically scale via either the frontend or the API.

  • Running Portainer in a Docker Container with Apache 2.4 mod_proxy and basic auth
  • Specify docker engine version with docker machine
  • connection refused when trying to connect redis using docker compose file
  • Is it possible to run docker services in dockerfile based on some conditions?
  • Bash variable inside third remote server
  • Docker and netstat: netstat is not showing ports, exposed by docker containers
  • This works great for test setups, but the question remains how to persist the data so that if either the cluster is scaled down (I know this is also about the index configuration itself) or stopped, and I want to restart later (or scale up) with the same data.

    The thing is that Marathon decides where (on which Mesos Slave) the nodes are run, so from my point of view it’s not predictable if the all data is available to the “new” nodes upon restart when I try to persist the data to the Docker hosts via Docker volumes.

    The only things that comes to my mind are:

    • Using a distributed file system like HDFS or NFS, with mounted volumes either on the Docker host or the Docker images themselves. Still, that would leave the question how to load all data during the new cluster startup if the “old” cluster had for example 8 nodes, and the new one only has 4.

    • Using the Snapshot API of Elasticsearch to save to a common drive somewhere in the network. I assume that this will have performance penalties…

    Are there any other way to approach this? Are there any recommendations? Unfortunately, I didn’t find a good resource about this kind of topic. Thanks a lot in advance.

  • How to skip a gradle task under some cases, which introduced by the bmuschko/gradle-docker-plugin?
  • cannot ssh Docker Provided Container with Vagrant. Vagrant ssh doesnt work too
  • Docker Compose: Accessing my webapp from the browser
  • Can I suspend and then resume Docker container?
  • Cannot start mosquitto as service on docker container
  • Logging events in Kubernetes cluster
  • 2 Solutions collect form web for “Strategy to persist the node's data for dynamic Elasticsearch clusters”

    Elasticsearch and NFS are not the best of pals ;-). You don’t want to run your cluster on NFS, it’s much too slow and Elasticsearch works better when the speed of the storage is better. If you introduce the network in this equation you’ll get into trouble. I have no idea about Docker or Mesos. But for sure I recommend against NFS. Use snapshot/restore.

    The first snapshot will take some time, but the rest of the snapshots should take less space and less time. Also, note that “incremental” means incremental at file level, not document level.

    The snapshot itself needs all the nodes that have the primaries of the indices you want snapshoted. And those nodes all need access to the common location (the repository) so that they can write to. This common access to the same location usually is not that obvious, that’s why I’m mentioning it.

    The best way to run Elasticsearch on Mesos is to use a specialized Mesos framework. The first effort is this area is There is a more recent project, which is, AFAIK, currently under development: I don’t know what is the status, but you may want to give it a try.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.