Hello!
We have a cluster with 10 Elastic Search nodes that we are using for
indexing our data. In order to perform searching, we are using a web
application(deployed on Tomcat web server) installed on a machine that
will be remote from ES. Therefore, we are using TransportClient in
order to connect to ElasticSearch.
But in order to do that in the right way, we would like to ask you
what is the best way to initialize this connection:
Adding all the ElasticSearch nodes to the TransportClient (using API)
In order to discover the ES network, what do you recommend :
Unicast or Multicast?
Where in the web application we should do this connection to ES ?
Can we use the ThreadLocal Pattern into a Singleton class and from
there to create the connection? Or we can initialize this connection
from ServletContextListener?
On Tuesday, June 14, 2011 at 11:15 AM, Spico Florin wrote:
Hello!
We have a cluster with 10 Elastic Search nodes that we are using for
indexing our data. In order to perform searching, we are using a web
application(deployed on Tomcat web server) installed on a machine that
will be remote from ES. Therefore, we are using TransportClient in
order to connect to Elasticsearch.
But in order to do that in the right way, we would like to ask you
what is the best way to initialize this connection:
Adding all the Elasticsearch nodes to the TransportClient (using API)
It is recommended to add as many addresses as you know to it. You can also enable sniffing so it will sniff the other nodes automatically.
In order to discover the ES network, what do you recommend :
Unicast or Multicast?
You mean for the cluster? Transport client always uses "unicast". As for the cluster, its up to you.
Where in the web application we should do this connection to ES ?
Can we use the ThreadLocal Pattern into a Singleton class and from
there to create the connection? Or we can initialize this connection
from ServletContextListener?
Up to you, as long as you don't create several client instances.
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.