Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by ryan: http://wiki.apache.org/solr/MultiCore ------------------------------------------------------------------------------ <!> ["Solr1.3"] - [[TableOfContents]] + See: CoreAdmin - = Overview = + In solr, the "multi core" concept refers to the ability to have multiple cores running in the same webapp. - Solr allows multiple SolrCore instances to run within a single web-app. The cores - can be dynamically managed via the MultiCoreHandler. For alternative ways to manage multiple indecies, see MultipleIndexes. - - = Configuration = - - To enable multi core support, place a file named ''solr.xml'' in the solr.home - directory. Here is an example ''solr.xml'' file: - {{{ - <solr persistent="true" sharedLib="lib"> - <cores adminPath="/admin/multicore"> - <core name="core0" instanceDir="core0" /> - <core name="core1" instanceDir="core1" /> - </cores> - </solr> - }}} - - == solr == - The `<solr>` tag accepts two attributes: - *'''persistent''' - By default, should runtime core manipulation be saved in ''solr.xml'' so that it is available after a restart. - *'''sharedLib''' - Path to a directory containing .jar files that are added to the classpath of every core. The path is relative to solr.home (where solr.xml sits) - - == cores == - The `<cores>` tag accepts one attribute: - *'''adminPath''' - RequestHandler path to access the !MultiCoreHandler for dynamic core manipulation. For example, adminPath="/admin/multicore" configures access via http://localhost:8983/solr/admin/multicore. If this attribute is not specified, dynamic manipulation is unavailable. - - == core == - The `<core>` tag accepts two attributes: - *'''name''' - The registered core name. This will be how the core is accessed. - *'''instanceDir''' - The ''solr.home'' directory for a given core. - - = Example = - - Solr ships with an example multicore setup. To run this configuration, start jetty using: - {{{ - java -Dsolr.solr.home=multicore -jar start.jar - }}} - - This will start solr running two cores: ''core0'', and ''core1''. To access each core, try: - http://localhost:8983/solr/core0/select?q=*:* - - http://localhost:8983/solr/core1/select?q=*:* - - - To access the admin pages for each core visit: - http://localhost:8983/solr/core0/admin/ - - http://localhost:8983/solr/core1/admin/ - - - = MultiCoreHandler = - - The !MultiCoreHandler is a special SolrRequestHandler that is used to manage existing cores. - Unlike normal !SolrRequestHandlers, the !MultiCoreHandler is not attached to a core, - it is configured in solr.xml. A single MultiCoreHandler exists for each web-app - - To enable dynamic core configuration, make sure the ''adminPath'' attribute is set in - solr.xml. If this attribute is absent, the !MultiCoreHandler will not be available. - - - == STATUS == - - Get the status for a given core or all cores if no core is specified: - - http://localhost:8983/solr/admin/multicore?action=STATUS&core=core0 - - http://localhost:8983/solr/admin/multicore?action=STATUS - - == CREATE == - - Creates a new core and register it. - If persistence is enabled (persist=true), the configuration for this new core will be saved in 'multicore.xml'. - If a core with the same name exists, while the "new" created core is initalizing, the "old" one will continue to accept requests. Once - it has finished, all new request will go to the "new" core, and the "old" core will be unloaded. - - http://localhost:8983/solr/admin/multicore?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&config=config_file_name.xml&schema=schem_file_name.xml - - Note that config & schema parameters are optional. - - == LOAD == - - /!\ '''not implemented yet!''' - - This will load a new core from an existing configuration (will be implemented when cores can be described with a lazy-load flag). - - ?persist=true will save the changes to solr.xml - - http://localhost:8983/solr/admin/multicore?action=LOAD&core=core0 - - == UNLOAD == - - /!\ '''not implemented yet!''' - - Remove a core from solr. Existing requests will continue to be processed, but no new - requests can be sent to this core. - - http://localhost:8983/solr/admin/multicore?action=UNLOAD&core=core0 - - - == RELOAD == - - Load a new core from the same configuration as an existing registered core. While the - "new" core is initalizing, the "old" one will continue to accept requests. Once - it has finished, all new request will go to the "new" core, and the "old" core will - be unloaded. - - http://localhost:8983/solr/admin/multicore?action=RELOAD&core=core0 - - - == SWAP == - - Change the names used to access a core - - http://localhost:8983/solr/admin/multicore?action=SWAP&core=core1&with=core0 - - --------- - - See [https://issues.apache.org/jira/browse/SOLR-215 SOLR-215] and [https://issues.apache.org/jira/browse/SOLR-350 SOLR-350] -
