Mudanças entre as edições de "Solr"

De MochilaWiki
Ir para navegaçãoIr para pesquisar
 
(6 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 15: Linha 15:
 
cp -R ~/solr-4.10.3/example/solr /var/lib/tomcat7
 
cp -R ~/solr-4.10.3/example/solr /var/lib/tomcat7
 
chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr
 
chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr
nano /var/lib/tomcat7/webapps/solr/WEB-INF/web.xml
+
</source>
nano /etc/tomcat7/tomcat-users.xml
+
 
 +
acrescente em antes de </tomcat-users> em /etc/tomcat7/tomcat-users.xml
 +
<source lang="xml">
 +
<role rolename="manager-gui"/>
 +
<role rolename="admin-gui"/>
 +
<user username="your_username" password="your_password" roles="manager-gui,admin-gui,solr-gui"/>
 +
</source>
 +
 
 +
altere your_username e your_password
 +
 
 +
acrescente antes de </web-app> no arquivo /var/lib/tomcat7/webapps/solr/WEB-INF/web.xml
 +
 
 +
<source lang="xml">
 +
<security-constraint>
 +
  <web-resource-collection>
 +
    <web-resource-name>Solr GUI Authentication</web-resource-name>
 +
    <url-pattern>/*</url-pattern>
 +
    <http-method>GET</http-method>
 +
    <http-method>POST</http-method>
 +
  </web-resource-collection>
 +
  <auth-constraint>
 +
    <role-name>solr-gui</role-name>
 +
  </auth-constraint>
 +
 
 +
  <user-data-constraint>
 +
    <transport-guarantee>NONE</transport-guarantee>
 +
  </user-data-constraint>
 +
</security-constraint>
 +
 
 +
<login-config>
 +
  <auth-method>BASIC</auth-method>
 +
</login-config>
 +
</source>
 +
 
 +
reinicie o tomcat
 +
<source lang="bash">
 
service tomcat7 start
 
service tomcat7 start
 
</source>
 
</source>
  
 +
acesse em http://192.168.0.13:8080/solr
 +
 +
== Como configurar no crontab para indexar o Solr automáticamente ==
 +
 +
<source lang="bash">
 +
crontab -e
 +
</source>
 +
 +
e insira
 +
0 */6  * * * curl http://seuservidor/solr/nome_do_core/nome_do_core?command=full-import
 +
 +
fonte
 +
http://dtelaroli.org/2014/08/como-configurar-crontab-para-indexar-solr-automaticamente-2
  
  
 
* [http://visaotecnologica.wordpress.com/2011/01/26/como-funciona-a-relevancia-no-solr/ Como funciona a relevância no Solr]
 
* [http://visaotecnologica.wordpress.com/2011/01/26/como-funciona-a-relevancia-no-solr/ Como funciona a relevância no Solr]
 +
* [https://pacoup.com/2014/02/05/install-solr-4-6-with-tomcat-7-on-debian-7/ Install Solr 4.6 with Tomcat 7 on Debian 7]
 +
* [http://gagannaidu.blogspot.com.br/2014/02/apache-solr-461-tomcat7-setup-on-ubuntu.html dica de log]
 +
* http://lucene.apache.org/solr/4_6_1/tutorial.html
 +
* https://github.com/williamchitto/SolrExample/blob/master/bin/Solr.html
 +
* http://dsign1.blogspot.com.br/2013/03/search-query-solr.html
 +
* http://dsign1.blogspot.com.br/2013/03/query-data-solr.html
 +
* http://brigomp.blogspot.com.br/2011/04/cinco-soluciones-basadas-en-lucene-para.html

Edição atual tal como às 20h46min de 10 de janeiro de 2015

No debian wheezy é possível instalar assim

apt-get install solr-tomcat

mas a versão padrão é 3.6.0, bem antiga, pois atualmente está na versão 4.10.3

outra forma de instalação

apt-get install openjdk-7-jre-headless tomcat7 tomcat7-admin
curl http://archive.apache.org/dist/lucene/solr/4.10.3/solr-4.10.3.tgz | tar xz
cp ~/solr-4.10.3/example/lib/ext/* /usr/share/tomcat7/lib/
cp ~/solr-4.10.3/dist/solr-4.10.3.war /var/lib/tomcat7/webapps/solr.war
cp -R ~/solr-4.10.3/example/solr /var/lib/tomcat7
chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr

acrescente em antes de </tomcat-users> em /etc/tomcat7/tomcat-users.xml

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="your_username" password="your_password" roles="manager-gui,admin-gui,solr-gui"/>

altere your_username e your_password

acrescente antes de </web-app> no arquivo /var/lib/tomcat7/webapps/solr/WEB-INF/web.xml

<security-constraint>
  <web-resource-collection>
    <web-resource-name>Solr GUI Authentication</web-resource-name>
    <url-pattern>/*</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
  </web-resource-collection>
  <auth-constraint>
    <role-name>solr-gui</role-name>
  </auth-constraint>

  <user-data-constraint>
    <transport-guarantee>NONE</transport-guarantee>
  </user-data-constraint>
</security-constraint>

<login-config>
  <auth-method>BASIC</auth-method>
</login-config>

reinicie o tomcat

service tomcat7 start

acesse em http://192.168.0.13:8080/solr

Como configurar no crontab para indexar o Solr automáticamente

crontab -e

e insira

0 */6  * * * curl http://seuservidor/solr/nome_do_core/nome_do_core?command=full-import

fonte http://dtelaroli.org/2014/08/como-configurar-crontab-para-indexar-solr-automaticamente-2