Consegui consertar removendo uma linha em branco no topo do arquivo solr.xml. Mas agora aparece um erro diferente, embora o Solr esteja funcionando agora.
Isso me ajudou a descobrir o problema:
Eu estava executando o Solr 4.1 no Windows Server 2008 R2. O Solr é implantado no Tomcat. No entanto, hoje ele pára de repente e, ao acessar o Solr, ele apresenta o seguinte erro.
HTTP Status 503 - Server is shutting down
type Status report
message Server is shutting down
description The requested service is not currently available.
Olhando mais para o Logs, temos o seguinte:
Arquivo de log: tomcat7-stderr.2013-05-09.txt
May 09, 2013 8:00:40 PM org.apache.solr.core.CoreContainer finalize
SEVERE: CoreContainer was not shutdown prior to finalize(), indicates a bug -- POSSIBLE RESOURCE LEAK!!! instance=2221663
Arquivo de registro: catalina.2013-05-09.txt
May 09, 2013 7:59:25 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: new SolrResourceLoader for directory: 'c:\solrdir\'
May 09, 2013 7:59:29 PM org.apache.solr.common.SolrException log
SEVERE: Exception during parsing file: null:org.xml.sax.SAXParseException; systemId: file:/c:/solr/solr.xml; lineNumber: 2; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.solr.core.Config.<init>(Config.java:121)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:428)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:404)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:336)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:98)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5309)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
May 09, 2013 7:59:29 PM org.apache.solr.servlet.SolrDispatchFilter init
SEVERE: Could not start Solr. Check solr/home property and the logs
May 09, 2013 7:59:29 PM org.apache.solr.common.SolrException log
SEVERE: null:org.apache.solr.common.SolrException:
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:431)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:404)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:336)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:98)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5309)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException; systemId: file:/c:/solrdir/solr.xml; lineNumber: 2; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.solr.core.Config.<init>(Config.java:121)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:428)
... 20 more
May 09, 2013 7:59:29 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done
May 09, 2013 7:59:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\docs
May 09, 2013 7:59:30 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\manager
May 09, 2013 7:59:30 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\ROOT
May 09, 2013 7:59:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8983"]
May 09, 2013 7:59:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 09, 2013 7:59:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9578 ms
May 09, 2013 8:00:40 PM org.apache.solr.core.CoreContainer finalize
SEVERE: CoreContainer was not shutdown prior to finalize(), indicates a bug -- POSSIBLE RESOURCE LEAK!!! instance=2221663
Alguma ideia do que pode estar errado e como corrigir?
Consegui consertar removendo uma linha em branco no topo do arquivo solr.xml. Mas agora aparece um erro diferente, embora o Solr esteja funcionando agora.
Isso me ajudou a descobrir o problema:
Eu tenho o mesmo problema quando copiei um núcleo.
O copiou a pasta, no meu caso, os usuários qa.
Quando mudei o name = users para name = qa dentro do arquivo core.properties , tudo voltou ao trabalho. p>
Cada minúsculo é importante, e como o Solr foi, infelizmente, escrito em Java, as mensagens de erro geralmente não valem nada.
Para estar seguro com seu XML, use algo como link para garantir que não seja um erro de sintaxe simples arruinando seu dia.
tente fechar a tag core em solr.xml; como:
<core name="eg1" instanceDir="eg1Dir"/>
Eu finalmente copiei todas as bibliotecas em dist/solrj-lib
(estou rodando no Linux) para /usr/share/tomcat7/lib
. Isso livrou-se do erro 503, mas além disso eu tive que alterar as permissões no diretório $SOLR_HOME
e nos sub-itens que pertenciam ao usuário e grupo tomcat7
e tive que editar o arquivo solr.xml
então eu estava saiu com apenas <solr/>
.
É uma missão e tanto montar o Solr nos dias de hoje. Seria bom se eles pudessem apenas fornecer um conjunto de padrões sãos e incluir bibliotecas para colocar tudo em funcionamento sem todas essas etapas.
Apenas para documentar essa solução alternativa caso alguém esteja enfrentando esse problema (no entanto, sem ver a "SAXParseException" nos logs do servidor de aplicativos do Solr):
Se você marcar esta classe: link
Você verá que ele retornará o HTTP 503 se não puder inicializar nenhum núcleo
if (this.cores == null) {
((HttpServletResponse)response).sendError( 503, "Server is shutting down" );
return;
}
Isto é, IMHO, meio que enganoso, mas, isso basicamente significa que você não tem núcleos / fragmentos no seu SolrCloud (ou seja, alguém pode estar mexendo com seus servidores Zookeeper), essa foi a causa raiz no meu caso , novamente, apenas compartilhando no caso de alguém estar enfrentando o mesmo problema.