Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
5.1 EE SP2 (5.1.5), 5.2 CE (5.2.3)
-
All
Description
A new LoadBalancerSolrServer class has been added to the Solr plugin. It accepts multiple IPs (one for each Solr server node). The load balancer will always hit the first server of the list. If the first server is down, it tries to make a request to the next server on the list. The recommended way for achieving load balancing is to use software/hardware load balancers between Liferay and solr servers but in some cases it is not possible or it's easier to just use this new LoadBalancerSolrServer.
To configure load balancing for Solr, edit solr-config.xml:
<bean id="solrServerFactory" class="com.liferay.portal.search.solr.server.SolrServerFactoryImpl">
<constructor-arg>
<map key-type="java.lang.String" value-type="org.apache.solr.client.solrj.SolrServer">
<entry key="node1">
<bean class="com.liferay.portal.search.solr.server.BasicAuthSolrServer">
<constructor-arg type="java.lang.String" value="http://localhost:8090/solr" />
</bean>
</entry>
<entry key="node2">
<bean class="com.liferay.portal.search.solr.server.BasicAuthSolrServer">
<constructor-arg type="java.lang.String" value="http://localhost:8080/solr" />
</bean>
</entry>
</map>
</constructor-arg>
</bean>
<bean id="solrServer1" class="com.liferay.portal.search.solr.server.LoadBalancerSolrServer">
<constructor-arg>
<ref bean="solrServerFactory" />
</constructor-arg>
</bean>
<bean id="liveServerChecker" class="com.liferay.portal.search.solr.server.LiveServerChecker">
<constructor-arg>
<ref bean="solrServerFactory" />
</constructor-arg>
<constructor-arg type="java.lang.Long" value="30" />
</bean>
<bean id="indexSearcher.solr" class="com.liferay.portal.search.solr.SolrIndexSearcherImpl">
<property name="solrServer" ref="solrServer1" />
</bean>
Attachments
Issue Links
- is related to
-
LPS-3824 Solr High Availability
-
- Closed
-