Significance of SOLR multicore

Source: Internet
Author: User
Tags solr

Post address: http://aixiangct.blog.163.com/blog/static/9152246120111128114423633/

Significance of SOLR multicore

SOLR multicore is SOLR 1.3
. The target SOLR instance can have multiple search applications. <Xmlnamespace prefix = "O" NS = "urn: Schemas-Microsoft-com: Office: office"/>

We can put different types of data in the same index, or use separate Multiple indexes. Based on this, you only need to know how to use multiple
Indexes(It is actually running SOLR.).However, adding a complete SOLR instance for each type is too bloated.

Solr1.3 introduces the concept of SOLR core. This solution uses a SOLR instance to manage multiple indexes, so that there is a hotspot core (hot
Core) reloading and switching (SWAP, usually the exchange of Read and Write indexes ),
Core or index is also easier. Each SOLR core consists of its own configuration file and index data. Performing search and indexing on multiple cores is almost the same as using a core. You just add the core names to different URLs. Search for a single core:

Http: // localhost: 8983/SOLR/select? Q = Dave % 20 donews

In a multi-core environment, you can access a core named mbartists in the following way:

Http: // localhost: 8983/SOLR/core0/select? Q = Dave % 20 donews

Instead of introducing the core name parameter value pair in the URL, different context is used. In this way, you can perform management tasks, search, and update operations in a single core.

 

Multicore configuration method

1. Find the example folder in the SOLR download package, and have a multicore folder under it. Copy core0, core1, and SOLR. xml under this folder
C: \ SOLR-Tomcat \ SOLR.

Note: There is a SOLR. XML (this is only the default file, of course, you can also specify another file), such:

<? XML version = "1.0" encoding = "UTF-8"?>

<SOLR persistent = "false">

<Cores adminpath = "/admin/cores">

<Core name = "core0" instancedir = "core0"/>

<Core name = "core1" instancedir = "core1"/>

</Cores>

</SOLR>

 

This file tells SOLR which cores should be loaded, <cores> ...... </Cores>
Core0 and core1. Core0 (comparable to the previous SOLR. home)/conf directory has schema. XML and solrconfig. XML, you can apply the actual/SOLR/CONF/schema. copy XML (Note: solrconfig. do not copy XML ).

 

2. start Tomcat and access the application. Admin core0 is displayed.
And Admin core1

Http: // 192.168.10.1: 8080/SOLR/

Http: // 192.168.10.1: 8080/SOLR/core0/admin/

Http: // 192.168.10.1: 8080/SOLR/core1/admin/

Http: // 192.168.10.1: 8080/SOLR/core1/admin/analysis. jsp

 

3. Use the default SOLR. XML, the index file will be stored in the same directory, where it will be stored in c: \ SOLR-Tomcat \ SOLR \ data. If you want to change the directory, or the two applications are stored in different directories. For more information, see the XML below.

<Core name = "core0" instancedir = "core0">

<Property name = "datadir" value = "/opt/SOLR-Tomcat/SOLR/data/core0"/>

</Core>

<Core name = "core1" instancedir = "core1">

<Property name = "datadir" value = "/opt/SOLR-Tomcat/SOLR/data/core1"/>

</Core>

 

 

You can also specify properties in SOLR. XML which can be used in the solrconfig. xml and schema. XML files.

<SOLR persistent = "true" sharedlib = "lib">

<Property name = "snapshooter" value = "/home/SOLR-user/SOLR/bin/snapshooter. Sh"/>

<Cores adminpath = "/admin/cores">

<Core name = "core0" instancedir = "core0">

<Property name = "datadir" value = "/data/core0"/>

</Core>

<Core name = "core1" instancedir = "core1"/>

</Cores>

</SOLR>

 

Some key configuration values are:

1. Persistent = "false" indicates that no modifications are saved during the runtime. Such as copying. If you want to save some changes from startup, set persistent to true. If your index policy is to complete index creation to a pure core and then switch to the active core, you should definitely set it to true.

2. sharedlib = "lib" indicates the lib directory of all core jar files. If you have a core that has its own JAR file, you can put them into the core/lib directory. For example, karaoke core uses SOLR cell to index rich text content. Therefore, Jar files used to parse and extract Rich Text are put in./examples/cores/karaoke/lib /.

 

Why use multiple cores?

It is better to enable multiple cores for a SOLR instance than to enable Multiple indexes (do more ). Multiple cores simultaneously address some key requirements in the production environment:

1. Re-Indexing

2. Test configuration change

3. Merge Indexes

4. Rename the core at runtime

Why is multi-core not the default one?

Multi-core is added only in version 1.3, and is more mature after version 1.4. We strongly recommend that you use multiple cores, which means that only one core is configured in SOLR. xml. Although it is a little more complex than a single index, it can bring the benefits of managing the core. Maybe a single core may eventually reload
And status command, or a single core may eventually be banned. Multiple cores will be the key to SOLR's support for large-scale distributed indexing in the future. Therefore, we can look forward to more in the future.

For more information about SOLR, visit http://wiki.apache.org/solr/coreadmin.

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.