Details

      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

            Activity

              People

              Assignee:
              support-ee EE Support
              Reporter:
              samuel.kong Samuel Kong
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  5.1 EE SP3 (5.1.6)
                  5.2 EE SP1 (5.2.5)