we are losing data in elastic search cluster
<p>We make a poc with ElasticSearch but while doing it, we lost data in clustered enviroment. We use ES 2.4.0.</p>

<p>Can anyone say what we are missing?</p>

<p>Our scenario is:</p>

<ol>
<li><p>Open Elastic Server-1 and Server-2 with the configurations below,
they are in a cluster. </p></li>
<li><p>Index document over Server-1:</p>

<p>curl -XPUT '20.20.20.5:9200/ert/post/1' -d '
{
"user": "easlan",
"postDate": "01-16-2015",
"body": "Adding Data in ElasticSearch Cluster" ,
"title": "ElasticSearch Cluster Test - 1"
}'</p></li>
<li><p>Look for indexed docs over Server-1 or Server-2:Total number of results is 1(as expected):</p>

<p>curl -XGET '20.20.20.5:9200/ert/post/_search?q=user:easlan&amp;pretty=true'
curl -XGET '20.20.20.6:9200/ert/post/_search?q=user:easlan&amp;pretty=true'</p></li>
<li><p>Then close Server-1</p></li>
<li><p>Index new document over Server-2:</p>

<p>curl -XPUT '20.20.20.6:9200/ert/post/2' -d '
{
"user": "easlan",
"postDate": "01-16-2015",
"body": "Adding Data in ElasticSearch Cluster" ,
"title": "ElasticSearch Cluster Test - 2"
 }'</p></li>
<li><p>Look for indexed docs over Server-2:Total number of results is 2:</p>

<p>curl -XGET '20.20.20.6:9200/ert/post/_search?q=user:easlan&amp;pretty=true'</p></li>
<li><p>Close Server-2</p></li>
<li><p>Open Server-1 </p></li>
<li><p>Look for indexed docs over Server-1:Total number of results is 1 (as expected, because server-2 is closed):</p>

<p>curl -XGET '20.20.20.5:9200/ert/post/_search?q=user:easlan&amp;pretty=true'</p></li>
<li><p>Then open Server-2 again. Look for indexed docs over Server-1 or Server-2. We expect to see total number of results as 2 but when we look, we got 1 as a result. Even we restart two of them again the result is still 1:</p>

<p>curl -XGET '20.20.20.5:9200/ert/post/_search?q=user:easlan&amp;pretty=true'
curl -XGET '20.20.20.6:9200/ert/post/_search?q=user:easlan&amp;pretty=true'</p></li>
</ol>

<p>Our Configurations:</p>

<pre><code>*** Server-1 ****
cluster.name: ESCluster
node.master: true
node.name: "es1"
node.data: true
network.bind_host: ["127.0.0.1","20.20.20.5"]
network.publish_host: "20.20.20.5"
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["20.20.20.5","20.20.20.6"]
discovery.zen.minimum_master_nodes: 1

*** Server-2 ****
cluster.name: ESCluster
node.master: true
node.name: "es2"
node.data: true
network.bind_host: ["127.0.0.1","20.20.20.6"]
network.publish_host: "20.20.20.6"
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["20.20.20.5","20.20.20.6"]
discovery.zen.minimum_master_nodes: 1
</code></pre>