Windows-Server-2008

如何修復 Solr - 伺服器正在關閉問題?

  • April 1, 2020

我在 Windows Server 2008 R2 上執行了 Solr 4.1。Solr 部署在 Tomcat 上。但是,今天它突然停止,並且在訪問 Solr 時出現以下錯誤。

HTTP Status 503 - Server is shutting down

type Status report

message Server is shutting down

description The requested service is not currently available.

在進一步查看日誌時,我們得到以下資訊:

日誌文件: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

日誌文件: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

知道可能出了什麼問題以及如何解決嗎?

我通過刪除 solr.xml 文件頂部的空行來修復它。但是現在出現了一個不同的錯誤,儘管 Solr 現在似乎正在執行。

這幫助我弄清楚了這個問題:

http://www.bennadel.com/blog/58-The-Processing-Instruction-Target-Matching-xX-mM-lL-is-Not-Allowed.htm

我在複製核心時遇到了同樣的問題。

O 將文件夾(在我的情況下是使用者)複製到 qa。

當我在core.properties文件中將****name=users更改為name=qa時,一切都恢復了工作。

每一點都很重要,遺憾的是,Solr 是用 Java 編寫的,錯誤消息通常毫無價值。

為了確保您的 XML 安全,請使用http://www.xmlvalidation.com/之類的內容,以確保這不是一個簡單的語法錯誤會毀了您的一天。

引用自:https://serverfault.com/questions/506399