Me, myself & Elastic Search Cluster

Post date: May 18, 2013 9:27:46 AM

The default configuration of Elastic Search Cluster allows starting the same instance twice in the same cluster. This fact can lead to the unpleasant situation that the cluster health becomes red. Let's say we setup a three instance cluster with the following instances: Franz Kafka, Albert Einstein and Steve Jobs.

By mistake we start the Franz Kafka instance twice and we create an index and add some documents to it. Replica configuration is the default one, so one replica and five shards. After a while we stop one Franz Kafka instance and then restart the cluster with the three correct instances pointing to three different installation folders of Elastic Search(the setup considers a local cluster with three instances).

The surprise is that the cluster health is red in this case, the shards created previously cannot be correctly managed anymore. By deleting the "data" folder which means losing all indexes and documents previously inserted, we get a cluster health of green at the prize of losing whole data.

In order to use an Elastic Search Cluster locally without running into such problems, it is advisable to alter the following configuration parameter "node.max_local_storage_nodes" under config/elasticsearch.yml.