Solr 7.2 cluster deployment details

Source: Internet
Author: User

Solr 7.2 cluster deployment details
Cluster: high availability, backup, and data sharding

Four tomcat servers are required.

1. tomcat port number (three ports 8080, and are used by default)

Tomcat Service

Occupied port

Tomcat1

6005, 6060, 6009

Tomcat2

7005, 7070, 7009

Tomcat3

8005, 8080, 8009

Tomcat4

9005, 9090, 9009

2. Create a solr cluster directory and copy the solr of a single node to this directory in four copies.

Create directory

[Root @ node004] # mkdir-p/usr/local/solrCloud

Copy A Single Node

[Root @ node004 ~] # Cp/usr/local/solr/usr/local/solrCloud/solr1-rf

[Root @ node004 ~] # Cp/usr/local/solr/usr/local/solrCloud/solr2-rf

[Root @ node004 ~] # Cp/usr/local/solr/usr/local/solrCloud/solr3-rf

[Root @ node004 ~] # Cp/usr/local/solr/usr/local/solrCloud/solr4-rf

Note: delete core. properties under each solrhome instance directory.

[Root @ node004 ~] # Rm/usr/local/solrCloud/solr1/home/jonychen/core. properties-rf
[Root @ node004 ~] # Rm/usr/local/solrCloud/solr2/home/jonychen/core. properties-rf
[Root @ node004 ~] # Rm/usr/local/solrCloud/solr3/home/jonychen/core. properties-rf
[Root @ node004 ~] # Rm/usr/local/solrCloud/solr4/home/jonychen/core. properties-rf

3. Modify 16 configuration files in solr 3.1

Solr. xml

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr1/home/solr. xml

 

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr2/home/solr. xml
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr3/home/solr. xml
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr4/home/solr. xml

3.2 tomcat configuration file server. xml

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr1/apache-tomcat-8.5.24/conf/server. xml

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr2/apache-tomcat-8.5.24/conf/server. xml
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr3/apache-tomcat-8.5.24/conf/server. xml
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr4/apache-tomcat-8.5.24/conf/server. xml

    

Web. xml

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr1/apache-tomcat-8.5.24/webapps/solr/WEB-INF/web. xml

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr2/apache-tomcat-8.5.24/webapps/solr/WEB-INF/web. xml
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr3/apache-tomcat-8.5.24/webapps/solr/WEB-INF/web. xml
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr4/apache-tomcat-8.5.24/webapps/solr/WEB-INF/web. xml

 

Catalina. sh

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr1/apache-tomcat-8.5.24/bin/catalina. sh

[Root @ node004 ~] # Vi/usr/local/solrCloud/solr2/apache-tomcat-8.5.24/bin/catalina. sh
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr3/apache-tomcat-8.5.24/bin/catalina. sh
[Root @ node004 ~] # Vi/usr/local/solrCloud/solr4/apache-tomcat-8.5.24/bin/catalina. sh

4. Upload the configuration file to zookeeper.

Call solr extract directory zkCli. sh to upload the configuration file

[root@node004 ~]# cd /root/solr-7.2.0/server/scripts/cloud-scripts/[root@node004 cloud-scripts]# lslog4j.properties  snapshotscli.sh  zkcli.bat  zkcli.sh[root@node004 cloud-scripts]# ./zkcli.sh -zkhost 192.168.178.161:2181,192.168.178.161:2182,192.168.178.161:2183  -cmd upconfig -confdir /usr/local/solrCloud/solr1/home/jonychen/conf/  -confname jonychen

Check whether the upload is successful

[Root @ node001 ~] #/Usr/local/zkCluster/zk1/bin/zkServer. sh status
ZooKeeper JMX enabled by default
Using config:/usr/local/zkCluster/zk1/bin/../conf/zoo. cfg
Mode: follower
[Root @ node001 ~] #/Usr/local/zkCluster/zk1/bin/zkCli. sh

If configs is available, the upload is successful.

[Zk: localhost: 2181 (CONNECTED) 1] quit
Quitting...

5. Start 4 tomcat

To view logs conveniently, copy the four windows and switch to their respective directories.

[Root @ node004 ~] # Cd/usr/local/solrCloud/solr1
[Root @ node004 solr1] # ls
Apache-tomcat-8.5.24 home logs
[Root @ node004 solr1] #./apache-tomcat-8.5.24/bin/startup. sh & tailf./apache-tomcat-8.5.24/logs/catalina. out

Startup successful page

 

6. Create a cluster

Create

Http: // 192.168.178.164: 6060/solr/admin/collections? Action = CREATE & name = jonychen & numShards = 2 & replicationFactor = 2

 

Delete

Http: // 192.168.178.164: 6060/solr/admin/collections? Action = DELETE & name = jonychen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.