lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <apa...@elyograg.org>
Subject Re: How http connections are handled in Solr?
Date Wed, 03 Jun 2015 14:58:33 GMT
On 6/3/2015 4:12 AM, Manohar Sripada wrote:
> 1. From my code, I am using CloudSolrServer of solrj client library to get
> the connection. From one of my previous discussion in this forum, I
> understood that Solr uses Apache's HttpClient for connections and the
> default maxConnections per host is 32 and default max connections is 128.
> 
> *CloudSolrServer cloudSolrServer = new CloudSolrServer(<zookeeper_quorum>);*
> 
> *cloudSolrServer.connect();*
> My first question here is what does this maxConnectionsperHost and
> maxConnections imply? Are these the connections from solrj client to the
> Zookeeper quorum OR from solrj client to the solr nodes?

By default, CloudSolrServer sets up an HttpClient object that is given
to the LBHttpSolrServer instance inside it.  The LBHttpSolrServer object
shares that HttpClient between all of the HttpSolrServer objects that it
maintains.

You can configure your own HttpClient in your code and then use that to
create CloudSolrServer:

http://lucene.apache.org/solr/5_1_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html#CloudSolrClient%28java.util.Collection,%20java.lang.String,%20org.apache.http.client.HttpClient%29

Zookeeper is a separate jar entirely, and handles its own network
connectivity.  That connectivity is NOT http.

> 3. Consider in my solr cloud I have one collection with 8 shards spread on
> 4 solr nodes. My understanding is that solrj client will send a query to
> one the solr core ( eg:solr core1) residing in one of the solr node (eg:
> node1). The solr core1 is responsible for sending queries to all the 8 Solr
> cores of that collection. Once it gets the response from all the solr
> cores, it merges the data and returns to the client. In this process, how
> the http connections between one solr node and rest of solr nodes are
> handled.

For distributed searching, Solr uses the SolrJ client internally to
collect responses from the shards.  The HttpClient for THAT
communication is configured with the shardHandler in solrconfig.xml.

https://wiki.apache.org/solr/SolrConfigXml?highlight=%28shardhandler%29#Configuration_of_Shard_Handlers_for_Distributed_searches

Thanks,
Shawn


Mime
View raw message