This is a newbie question about how the cluster works. I try to find the
answer from the group, but seems not exact the same question I have.
By reading the guide from elasticsearch.com, I understand when a master
node goes down, a new master node will be elected automatically. However, a
client does not know that and he still tries to query the old master node.
I was wondering what the result will be.
Assume I already have data indexed into 5 nodes, n1 to n5, where n1 is the
original master node. so when the client queries, the client do something
like: curl -XPOST "http://n1:9200/movies/movie/_search?q=*:Godfather",
life is good so far.
When n1 node goes down, assume n2 becomes the new master node. Since the
client does no know n1 is down, he still submits the same query to n1, what
result will be returned?
Should a client query the cluster instead of querying a master node? How to
submit a query to the cluster?
Have a client instance of elasticsearch on a different server or on the
same server that does the query. That node must be set to master=false and
data=false. Being a member of the cluster means you know where the data is.
Use a http reverse proxy that connects to all the nodes in the cluster,
if http 9200 is unavailable on one node then traffic is sent to the other
nodes.
Best option is to combine the two. Have two elasticsearch nodes as client
members of the cluster, install a reverse proxy on those two and
loadbalance between them on the IP level with a solution of choice.
With Java client, you have not to worry about that. You have either
multiple node connections or explicitly chosen the nodes to connect to
(transport client).
With HTTP client, the official Elasticsearch clients provide methods to
connect to multiple hosts. If one host goes down, the next one is chosen.
This is a newbie question about how the cluster works. I try to find the
answer from the group, but seems not exact the same question I have.
By reading the guide from elasticsearch.com, I understand when a master
node goes down, a new master node will be elected automatically. However, a
client does not know that and he still tries to query the old master node.
I was wondering what the result will be.
Assume I already have data indexed into 5 nodes, n1 to n5, where n1 is the
original master node. so when the client queries, the client do something
like: curl -XPOST "http://n1:9200/movies/movie/_search?q=*:Godfather",
life is good so far.
When n1 node goes down, assume n2 becomes the new master node. Since the
client does no know n1 is down, he still submits the same query to n1, what
result will be returned?
Should a client query the cluster instead of querying a master node? How
to submit a query to the cluster?
On Thursday, December 4, 2014 7:58:07 AM UTC-5, Elvar Böðvarsson wrote:
Two options
Have a client instance of elasticsearch on a different server or on the
same server that does the query. That node must be set to master=false and
data=false. Being a member of the cluster means you know where the data is.
Use a http reverse proxy that connects to all the nodes in the cluster,
if http 9200 is unavailable on one node then traffic is sent to the other
nodes.
Best option is to combine the two. Have two elasticsearch nodes as client
members of the cluster, install a reverse proxy on those two and
loadbalance between them on the IP level with a solution of choice.
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.