Reputation: 11
I am using two ES nodes (ES version 1.0.1) in cluster and I need clarification for following:
When I start application and it connects to both nodes and I can see requests served by both nodes but when I stop one of server it throws exception and other node still works but 50% of requests still get exception and whole traffic is not diverted to running node.
I have following configuration for cluster: 1st Node:
discovery.zen.minimum_master_nodes: 1
node.data: true
discovery.zen.ping.unicast.hosts: ["product-elasticsearch-1","product-elasticsearch-2"]
node.master: true
couchbase.maxConcurrentRequests: 1024
2nd Node
discovery.zen.minimum_master_nodes: 1
node.data: true
discovery.zen.ping.unicast.hosts: ["product-elasticsearch","product-elasticsearch-2"]
node.master: false
couchbase.maxConcurrentRequests: 1024
Following is code for transport client:
settings = ImmutableSettings.settingsBuilder().put("cluster.name", clusterName)
.put("es.http.timeout",timeout)
.put("client.transport.ping_timeout",pingTimeout)
.put("es.http.retries",retries)
.build();
for (String host : hostList) {
transportAddressList.add(new InetSocketTransportAddress(host,port));
}
Collections.shuffle(transportAddressList);
// Using Transport Client
trasportClient = new TransportClient(settings).addTransportAddresses(transportAddressList.toArray(addressArray));
Could someone please let me know when I stop one ES process why all requests are not served by running node?
Upvotes: 1
Views: 688
Reputation: 11
Thanks for reply. So another observation/solution is that if we run in master-master mode where node.master : true for both ES nodes it works meaning if one of node goes down then other will work. But if we run two ES nodes in master-slave mode where for slave node.master is false and master is down then slave will not work without master. Is there any way we can make master-slave model working with only slave when master is down?
Upvotes: 0
Reputation: 4733
Which one are you bringing down? The second node has the following property: node.master: false
This could result in problems if only that node is running.
Hope it helps
Upvotes: 0