Linux solr8 stand-alone installation and deployment

1. Introduction to Solr

  Solr is a high-performance, Java-based, Lucene-based full-text search server. At the same time, it has been expanded to provide a richer query language than Lucene, and at the same time, it is configurable, scalable, and optimized for query performance, and provides a complete function management interface. It is a very good Full text search engine. Documents are added to a search collection using XML over Http. Querying the collection is also accomplished by receiving an XML/JSON response over http. Its main features include: efficient and flexible caching capabilities, vertical search capabilities, highlighting of search results, improved usability through index replication, a set of powerful Data Schema to define fields, type and set text analysis, provide Web-based management interface, etc. Blog experimental environment:

  • Operating system: centos7.6
  • solr version: 8.11.1
  • jdk version: 1.8.0_291

2. Installation steps

0. Install jdk8

  Solr requires a java environment. For the JDK installation steps, see the blog post: JDK installation and upgrade for Linux

1. Download the software package

#Visit the solr official website to copy the download link, the link address
[wuhs@s142 ~]$ wget --no-check-certificate https://www.apache.org/dyn/closer.lua/lucene/solr/8.11.1/solr -8.11.1.tgz?action=download
insert image description here

2. Check the integrity

[wuhs@s142 ~]$ mv solr-8.11.1.tgz?action=download solr-8.11.1.tgz
[wuhs@s142 ~]$ sha512sum solr-8.11.1.tgz
4893f836aec84b03d7bfe574e59e305c03b5ede4a48020034fbe81440b8feee79e55fd9ead230e5b89b3f25124e9b56c1ddc4bb5c7f631cf4e846b9cab5f9a45 solr-8.11.1.tgz
insert image description here
insert image description here

3. Unzip the package

[wuhs@s142 ~]$ tar -zxvf solr-8.11.1.tgz

4. Create soft links

[wuhs@s142 ~]$ ln -s solr-8.11.1 solr

5. Start solr

[wuhs@s142 solr]$ ./bin/solr start
NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.

Started Solr server on port 8983 (pid=11063). Happy searching!

6. Check the service port

insert image description here

7. View the solr control panel

insert image description here

8. Create a core

[wuhs@s142 solr]$ mkdir -p /home/wuhs/solrhome/data
[wuhs@s142 solr]$ cp -r ./server/solr/configsets/_default/conf ~/ solrhome/ #Note
: you need to create instanceDir, The dataDir related directory needs to have config and schema configuration files, otherwise an error will be reported.
insert image description here

9. View core

insert image description here

3. QA

1. There is an alarm Your open file limit is currently 1024 when starting.

  • 告警信息:Your open file limit is currently 1024. It should be set to 65000 to avoid operational disruption.
  • Cause of the alarm: The default value of the user limit parameter does not meet the Solr requirements
  • Solution: Use the root account to modify the /etc/security/limits.conf parameter greater than 65000, and the reconnection of the ordinary account will take effect.
    [root@s142 ~]# vim /etc/security/limits.conf #Insert
    the following:
    #solr service system parameter requirements
    wuhs soft noproc 65535
    wuhs hard noproc 65535
    wuhs soft nofile 65535
    wuhs hard nofile 65535

2. There is an alarm Your Max Processes Limit is currently 4096 when starting

  • Warning information:
  • Alarm reason:
  • Solution: Modify the /etc/security/limits.d/20-nproc.conf parameter with the root account, and the normal account reconnection will take effect.
    [root@s142 ~]# vim /etc/security/limits.d/20-nproc.conf #Insert
    the following:
    #solr service system parameter requirements
    wuhs soft nproc 65535
    wuhs hard nproc 65535

3. Error when creating core

  • 报错信息:Path /home/wuhs/solrhome must be relative to SOLR_HOME, SOLR_DATA_HOME coreRootDirectory. Set system property ‘solr.allowPaths’ to add other allowed paths.
  • Reason for error: Dsolr.allowPaths parameter does not have this path
  • Solution: Modify the solr.allowPaths parameter of the solr.in.sh file and add the datadir path to the parameter
    [wuhs@s142 solr]$ vim +242 bin/solr.in.sh #Add
    your datadir path to the parameter
    SOLR_OPTS=" $SOLR_OPTS -Dsolr.allowPaths=/mnt/bigdisk,/other/path,/home/wuhs/solrhome"

4. Error solrconfig.xml cannot be found when creating core

  • 报错信息:Error CREATEing SolrCore ‘test_core’: Unable to create core [test_core] Caused by: Can’t find resource ‘solrconfig.xml’ in classpath or ‘/home/wuhs/solrhome’
  • Reason for error: There is no solrconfig.xml file in the newly created folder
  • Solution: Copy a conf directory to the instanceDir directory
    [wuhs@s142 solr]$ cp -r ./server/solr/configsets/_default/conf ~/solrhome/

Guess you like

Origin blog.csdn.net/carefree2005/article/details/123372891