I have a 3 node Elasticsearch cluster (2 data nodes).
My solution needs to support full replication if any 1 of the 3 nodes goes down or simply shutdown. I've been turning the ES server processes off and on and the replication always works correctly no matter what I do - when I have just 1 index (defaults of 5 primary shards and 1 replica). So everything works great and does what is required.
But a new requirement has just come in to add a second separate index (same defaults of 5 primary shards and 1 replica). But since I added this new index (even though it contains no data) it seems to break the replication on my first index. In that when I test it by shutting down and rebooting nodes I can see data go missing in kibana. Sometimes when I restore the previous master I can see the data come back.
Is this expected behavior in Elasticsearch 2.3.1 - can adding a second index break replication like this?
How many master eligible nodes do you have in the cluster? If this is 2 or 3, have you set discovery.zen.minimum_master_nodes to 2 so you can avoid split brain scenarios?
Thanks for your quick reply.
My cluster has 3 eligible master nodes and:
discovery.zen.minimum_master_nodes is set to 2
The issue just seems to be with the cluster node being issued a shutdown command and elasticsearch is not getting to shutdown correctly - if I call a shutdown script when the cluster node is being shutdown - it should fix the issue.
On each Elasticsearch node, I edited this file:
/usr/lib/systemd/system/elasticsearch.service
And added this line:
ExecStop=/usr/share/elasticsearch/bin/elasticsearch stop
Now when a node is issued a shutdown or reboot command no data is lossed.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.