SOLR Multi-core configuration

Source: Internet
Author: User
Tags solr

SOLR Multi-core (multicore) configuration

SOLR multicore significance

SOLR multicore is a new feature of SOLR 1.3 . Its purpose is a solr instance that can have multiple search applications. < XmlNamespace prefix = "o" ns = "Urn:schemas-microsoft-com:office:office"/>

       we areyou can put different types of data intoThe sameIndex, you can also use a separate multi- indexes. Based on this, you only need to know how to use multiple Indexes(which is actually A multi-instance running SOLR). However, adding a complete SOLR instance for each type would be too bloated and bulky.

Solr1.3Introduced aSOLR CoreConcept, the scheme uses aSOLRInstance manages multipleIndexes, so there's a hot spotCore(Hot Core) is stressed (Reloading) and Exchange (Swap, usually a read index and write index Exchange), then it's easier to manage a core or index . Each SOLR core consists of its own configuration file and index data. performing searches and indexes on multiple cores is almost as much as not using a core . You just add the core name for each of the different URLs. the following search in single core case:

Http://localhost:8080/solr/select?q=dave%20matthews

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

Http://localhost:8080/solr/core0/select?q=dave%20matthews

Instead of introducing the parameter name value pairs for the core name in the URL, a different contextis used. This allows you to perform your administrative tasks, search, and update operations like in single core .

How to configure Multicore

1, find the example folder in solr download package , under it there is a multicore folder, the folder below the Core0,core1 , and solr.xml are copied below the C:\SOLR-TOMCAT\SOLR .

Note: There is a solr.xml(This is just the default file, and of course you can specify other files), such as:

<?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 is to tellSOLRWhat should be loadedCore,<cores>......< Span style= "font-family: ' Times New Roman ';" > core0 , core1 . core0 (can be analogous to previous solr.home ) /conf directory with schema.xml and solrconfig.xml , you can put the actual application of /solr/conf/ Schema.xml Copy it Over (note: solrconfig.xml do not copy).

2, launch Tomcat, access to the application, you can see the admin core0 and admin core1

http://localhost:8080/solr/

http://localhost:8080/solr/core0/admin/

http://localhost:8080/solr/core1/admin/

http://localhost:8080/solr/core1/admin/ analysis.jsp

3, using the above 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 if two apps are in a different directory, see the XMLbelow.

<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 is 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 of the key configuration values are:

1.persistent= "False" indicates any modifications to the runtime we do not save. such as copy. If you want to save some changes from the startup, set the persistent to true. If your index strategy is to finish building the index into a pure core and then swap it to the active core then you should definitely set it to true.

2.sharedlib= "Lib" indicates the Lib directory for all core jar files. If you have a core with a jar file of your own, then you can put them into the Core/lib directory. For example: Karaoke core uses the Solr cell to index Rich text content, so those jar files used to parse and extract rich text are put into the./examples/cores/karaoke/lib/.

Why use multi-core

The SOLR instance supports multi- core better than enabling multi- index (do). Multi- core also addresses some of the key requirements in a production environment:

1. Rebuilding the Index

2. Test Configuration changes

3. Merging Indexes

4. Rename core at runtime

why more Core not the default?

ManyCoreIs1.3Version is only added,1.4 is more mature. We strongly recommend that you use multi-core , as you now solr.xml is configured with only one core , although slightly more complex than a single index, can bring management core On the benefits. Perhaps one day a single core may end reload and STATUS command, or perhaps a single core will eventually be banned. Multiple core will be SOLR key to support large-scale distributed indexes in the future. Therefore, you can expect more later.

You can get more information about SOLR :http://wiki.apache.org/solr/CoreAdmin.

SOLR Multi-core configuration

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.