java common service cluster building [8] solrcloud

Solrcloud is the cluster of solr. This paper will explain how to build solrcloud cluster.

1. Preconditions

2. Modify solr.xml

(1)Amendment 192.168.100.134 Medium/root/solr-4.10.3/example/solr/solr.xml
    <str name="host">${host:}</str>
    <int name="hostPort">${jetty.port:8983}</int>
by
    <str name="host">192.168.100.134</str>
    <int name="hostPort">8080</int>
(2)Amendment 192.168.100.135 Medium/root/solr-4.10.3/example/solr/solr.xml
    <str name="host">${host:}</str>
    <int name="hostPort">${jetty.port:8983}</int>
by
    <str name="host">192.168.100.135</str>
    <int name="hostPort">8080</int>
(3)Amendment 192.168.100.136 Medium/root/solr-4.10.3/example/solr/solr.xml
    <str name="host">${host:}</str>
    <int name="hostPort">${jetty.port:8983}</int>
by
    <str name="host">192.168.100.136</str>
    <int name="hostPort">8080</int>

3. Modify / root/apache-tomcat-8.5.38/bin/catalina.sh on the three machines respectively

Add on line 2:

JAVA_OPTS="-DzkHost=192.168.100.134:2181,192.168.100.135:2181,192.168.100.136:2181"

4. Use zookeeper to uniformly manage solr configuration files

#Go to the bin directory of zookeeper
cd  /root/zookeeper-3.4.11/bin/
#Upload solr's configuration file. Note that one upload is enough, that is, one execution in one machine.
#-zkhost: specify the address list of zookeeper; upconfig: upload the configuration file; - confdir: specify the directory where the configuration file is located; - confname: specify the directory name after uploading to zookeeper.
/root/solr-4.10.3/example/scripts/cloud-scripts/zkcli.sh -zkhost 192.168.100.134:2181,192.168.100.135:2181,192.168.100.136:2181 -cmd upconfig -confdir /root/solr-4.10.3/example/solr/collection1/conf -confname myconf

5. Restart tomcat respectively

View the solr management interface of any machine in the browser, for example http://192.168.100.134:8080/solr/#/collection1 , you will see the following pages:

solrcloud has one more Cloud


So far, we have completed the construction of solrcloud.
 

Tags: solr Zookeeper xml Jetty

Posted on Fri, 08 Nov 2019 09:43:53 -0500 by PDP11