Instalación de Solr 4.6.1 (multicore) bajo Tomcat 7.0.54 en Centos 6.6 x86_64

Submitted by admin on Sun, 12/28/2014 - 12:40

Aqui se pueden seguir los pasos para ejecutar Solr 4.6.1 (multicore) bajo Tomcat 7.0.54 en Centos 6.6 x86_64

1. Descargar solr-4.6.1 y descomprimir de modo que quede asi /usr/local/src/solr-4.6.1

2. Descargar tomcat-7.0.54 y descomprimir de modo que quede asi /usr/local/src/apache-tomcat-7.0.54

3. Copiar /usr/local/src/solr-4.6.1/dist/solr-4.6.1.war a /usr/local/src/apache-tomcat-7.0.54/webapps/solr.war

4. Crear la carpeta /usr/local/src/solr

5. Copiar el contenido de la carpeta /usr/local/src/solr-4.6.1/example/multicore a la carpeta /usr/local/src/solr

<code>
drwxr-xr-x 5 root root 4096 Dec 27 20:27 ./
drwxr-xr-x 15 root root 4096 Dec 27 20:27 ../
-rw-r--r-- 1 root root 267 Nov 18 2013 README.txt
drwxr-xr-x 3 root root 4096 Nov 18 2013 core0/
drwxr-xr-x 3 root root 4096 Nov 18 2013 core1/
drwxr-xr-x 2 root root 4096 Dec 27 20:27 exampledocs/
-rw-r--r-- 1 root root 1414 Nov 18 2013 solr.xml
-rw-r--r-- 1 root root 501 Nov 18 2013 zoo.cfg
</code>

Si no se desea multicore y solo se desea una instalacion simple entonces copiar el contenido de la carpeta /usr/local/src/solr-4.6.1/example/solr a la carpeta /usr/local/src/solr

<code>
xr-xr-x 4 root root 4096 Dec 27 20:27 ./
drwxr-xr-x 15 root root 4096 Dec 27 20:27 ../
-rw-r--r-- 1 root root 2473 Nov 18 2013 README.txt
drwxr-xr-x 2 root root 4096 Nov 18 2013 bin/
drwxr-xr-x 4 root root 4096 Dec 27 21:32 collection1/
-rw-r--r-- 1 root root 1715 Nov 18 2013 solr.xml
-rw-r--r-- 1 root root 501 Nov 18 2013 zoo.cfg
</code>

5. Crear el archivo /usr/local/src/apache-tomcat-7.0.54/conf/Catalina/localhost/solr.xml
con el siguiente contenido

<code>
<Context docBase="/usr/local/src/apache-tomcat-7.0.54/webapps/solr.war" debug="0" crossContext="true" >
<Environment name="solr/home" type="java.lang.String" value="/usr/local/src/solr" override="true" />
</Context>
</code>

6. Iniciar Tomcat

sh /usr/local/src/apache-tomcat-7.0.54/bin/startup.sh

Si desea detener Tomcat solo tiene que ejecutar

sh /usr/local/src/apache-tomcat-7.0.54/bin/shutdown.sh

7. Acceder al panel de administracion de Solr en

http://example:8080/solr

donde example debe ser reemplazado por el dominio que usted usa

8. Si desea agregar un Solr "core" mas, digamos uno llamado "drupal" , edite el archivo /usr/local/src/solr/solr.xml

<code>
<?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" host="${host:}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
<core name="core0" instanceDir="core0" />
<core name="core1" instanceDir="core1" />
<!-- I have added a core more named drupal-->
<core name="drupal" instanceDir="drupal" />
</cores>
</solr>
</code>
9. Crear la carpeta "drupal" en /usr/local/src/solr
<code>
drwxr-xr-x 6 root root 4096 Dec 28 08:30 ./
drwxr-xr-x 14 root root 4096 Dec 28 08:28 ../
-rw-r--r-- 1 root root 267 Dec 28 08:26 README.txt
drwxr-xr-x 4 root root 4096 Dec 28 08:27 core0/
drwxr-xr-x 4 root root 4096 Dec 28 08:27 core1/
drwxr-xr-x 2 root root 4096 Dec 28 08:26 exampledocs/
drwxr-xr-x 4 root root 4096 Dec 28 08:34 drupal/
-rw-r--r-- 1 root root 1470 Dec 28 08:31 solr.xml
-rw-r--r-- 1 root root 1414 Dec 28 08:29 solr.xml.dist
-rw-r--r-- 1 root root 501 Dec 28 08:26 zoo.cfg
</code>
10. (Solo si esta usando el modulo ApacheSolr de Drupal), copie los archivos dentro del modulo "apachesolr" http://cgit.drupalcode.org/apachesolr/tree/solr-conf/solr-4.x a la carpeta que acabamos de crear /usr/local/src/solr/drupal

11. Reiniciar Tomcat e ir al panel de administracion de Solr para visualizar el nuevo "core" que hemos agregado

sh /usr/local/src/apache-tomcat-7.0.54/bin/shutdown.sh
sh /usr/local/src/apache-tomcat-7.0.54/bin/startup.sh

Links

http://forumone.com/insights/installing-solr-and-search-api-on-ubuntu-1…

http://florezgroup.com/blog/configuring-apache-solr-multi-core-drupal-a…

https://www.drupal.org/node/484800

http://docs.ckan.org/en/ckan-1.8/solr-setup.html

Etiquetas