Apache Solr3.4.0ã®ãã«ãã³ã¢æ©è½ã§åµã£ãæã®ã¡ã¢
CentOS5.7で全文検索エンジンApache Solr3.4.0のインストールからMySQLデータのインポートまで
Apache Solrå ¥é âãªã¼ãã³ã½ã¼ã¹å ¨ææ¤ç´¢ã¨ã³ã¸ã³
- ä½è : é¢å£å®å¸,ä¸é¨é夫,æ¦ç°å å¹³,ä¸éç,大谷ç´
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2010/02/20
- ã¡ãã£ã¢: 大åæ¬
- è³¼å ¥: 18人 ã¯ãªãã¯: 567å
- ãã®ååãå«ãããã° (22件) ãè¦ã
ã®è¨äºã®ç¶ãã§ãã
ãã«ãã³ã¢åä½æ¥ãé²ããæã«åµã£ããã¨ãã¡ã¢ãã¾ããã
Solrã®ãã«ãã³ã¢æ©è½
é常1ã¤ã®Solrããµã¼ãã¬ããã³ã³ããã«ãããã¤ããã¨ã1ã¤ã®ã¤ã³ããã¯ã¹ã¨ããã«å¯¾å¿ããã¤ã³ã¿ãã§ã¼ã¹ãæä¾ããã¾ãã
ãã«ãã³ã¢ãå©ç¨ããã¨ã1ã¤ã®solrä¸ã«è¤æ°ã®ã¤ã³ããã¯ã¹ã¨ããã«å¯¾å¿ããã¤ã³ã¿ãã§ã¼ã¹ãå©ç¨ãããã¨ãã§ãã¾ãã
ã¤ã³ã¹ãã¼ã«ãããSolrã®exampleã«ã¯ãmulticoreã¨ãããã£ã¬ã¯ããªãããã¾ãã®ã§ãããå©ç¨ãã¾ãã
ãã«ãã³ã¢ã®æºå
å
ã»ã©ã®ä½æããè¨å®ãã³ãã¼ãã¾ãã
cd /usr/local/apache-solr/example/ cp -Rp solr/conf/* multicore/core0/conf/ cp -Rp solr/conf/* multicore/core1/conf/
ãã«ãã³ã¢ã®æå¹å
solrãèµ·åããéã«multicoreè¨å®ãã¡ã¤ã«ã§ããsolr.xmlãç½®ããããã£ã¬ã¯ããªãæå®ãã¾ãã
solr.xmlã¯ã³ã¢ã®å
¥ãæ¿ãå¦çãè¡ããªã¯ã¨ã¹ããã³ãã©ã¨ã³ã¢åãè¨å®ãã¡ã¤ã«ã®å ´æãªã©ãæå®ããã¦ãã¾ãã
example/multicoreã®solr.xml
<?xml version="1.0" encoding="UTF-8" ?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- All (relative) paths are relative to the installation path persistent: Save changes made via the API to this file sharedLib: path to a lib directory that will be shared across all cores --> <solr persistent="false"> <!-- adminPath: RequestHandler path to manage cores. If 'null' (or absent), cores will not be manageable via request handler --> <cores adminPath="/admin/cores"> <core name="core0" instanceDir="core0" /> <core name="core1" instanceDir="core1" /> </cores> </solr>
å ã»ã©ã®èµ·åã¹ã¯ãªããã®å ´åã13è¡ç®ã®CORE=solr
ã以ä¸ã®ããã«å¤æ´ãã¾ãã
vi /etc/init.d/solr
CORE=multicore
Solrã®åèµ·å
/etc/init.d/solr restart
管çç»é¢ã«ã¢ã¯ã»ã¹
http://localhost:8983/solr/core0/admin/
ããããã®ã³ã¢ã®ç®¡çç»é¢ã«ã¯/solr/ã³ã¢å/adminã¨ããå½¢ã§ã¢ã¯ã»ã¹ã§ãã¾ãã
ãããããã§åé¡çºçã
HTTP ERROR 500 Problem accessing /solr/core0/admin. Reason: Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change: <abortOnConfigurationError>false</abortOnConfigurationError> in solr.xml ------------------------------------------------------------- org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.handler.dataimport.DataImportHandler'
DataImportHandlerã¯ã©ã¹ãè¦ã¤ãããªãã¨ããã¨ã©ã¼ãåºã¾ããã
ãã«ãã³ã¢åã¯ã¡ããã¨ãã¼ã¿ã¤ã³ãã¼ã¿ã¼ã¯èµ·åã§ãã¦ããã®ã§ããã«ãã³ã¢åããéã«ä½ãåé¡ããã£ãããã§ãã
調ã¹ã¦ã¿ãã¨ä»¥ä¸ã®ãã©ã¼ã©ã è¨äºãåèã«ãªãã¾ããã
dist/apache-solr-dataimporthandler-3.4.0.jarãç¸å¯¾ãã¹ã§è¦ã¤ãããªãã£ãã®ãåå ã ã£ãããã§ãã
ãã«ãã³ã¢ååã®solr/conf/solrconfig.xmlã§ã¯ã
<lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
ã¨ãªã£ã¦ãã¾ãããããã¯/usr/local/apache-solr/example/solrããè¦ã¦distãã£ã¬ã¯ããªã2ã¤ä¸ã«ãã£ãã®ã§åé¡ãªãã£ãã®ã§ããããã«ãã³ã¢åãããã¨ã«ããã³ã¢ã®ãã£ã¬ã¯ããªãã/usr/local/apache-solr/example/multicore/{core0,core1}ã«ãªããããä¸è¨ã®ããã«å¤æ´ããå¿ è¦ãããã¾ããã
<lib dir="../../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
core0ãcore1ã®solrconfig.xml両æ¹ãå¤æ´ãã¦ãããsolrã®åèµ·åãè¡ãã¾ãããã