2014-02-25 73 views
1

我使用Solr 4.6.1設置Solr服務器。無法啓動Solr。檢查solr /家庭財產和日誌

當我啓動服務器(sudo /etc/init.d/solr start)時,當我嘗試訪問Web界面時出現「HTTP ERROR 503」,並在solr.log中顯示以下錯誤:

INFO - 2014-02-25 14:16:44.006; org.apache.solr.core.CorePropertiesLocator; Looking for core definitions underneath /opt/solr/indexes 
ERROR - 2014-02-25 14:16:44.032; org.apache.solr.servlet.SolrDispatchFilter; Could not start Solr. Check solr/home property and the logs 
ERROR - 2014-02-25 14:16:44.088; org.apache.solr.common.SolrException; null:java.lang.NullPointerException 
     at org.apache.solr.core.CorePropertiesLocator.discoverUnder(CorePropertiesLocator.java:121) 
     at org.apache.solr.core.CorePropertiesLocator.discoverUnder(CorePropertiesLocator.java:130) 
     at org.apache.solr.core.CorePropertiesLocator.discover(CorePropertiesLocator.java:113) 
     at org.apache.solr.core.CoreContainer.load(CoreContainer.java:226) 
     at org.apache.solr.servlet.SolrDispatchFilter.createCoreContainer(SolrDispatchFilter.java:177) 
     at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:127) 
     at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 
     at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:719) 
     at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265) 
     at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1252) 
     at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710) 
     at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 
     at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:39) 
     at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186) 
     at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494) 
     at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141) 
     at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145) 
     at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56) 
     at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609) 
     at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540) 
     at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403) 
     at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 
     at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 
     at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555) 
     at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 
     at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:81) 
     at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:96) 
     at org.eclipse.jetty.server.Server.doStart(Server.java:280) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 
     at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:606) 
     at org.eclipse.jetty.start.Main.invokeMain(Main.java:473) 
     at org.eclipse.jetty.start.Main.start(Main.java:615) 
     at org.eclipse.jetty.start.Main.main(Main.java:96) 

INFO - 2014-02-25 14:16:44.098; org.apache.solr.servlet.SolrDispatchFilter; SolrDispatchFilter.init() done 
INFO - 2014-02-25 14:16:44.312; org.eclipse.jetty.server.AbstractConnector; Started [email protected]:8983 

當檢查的進程列表,Solr的非常存在:

/usr/bin/java -Dsolr.solr.home=/opt/solr/current/solr -DcoreRootDirectory=/opt/solr/indexes -Xmx1024m -DsharedLib=/opt/solr/sharedLib -Djetty.logs=/var/log/solr -Djetty.home=/opt/solr/current -Djava.io.tmpdir=/tmp -jar /opt/solr/current/start.jar --daemon 

任何想法,這將是可能的原因是什麼?

+0

Solr是否正確地啓動java -jar start.jar?如果是這樣,你可能想看看http://stackoverflow.com/a/2150888/158328 –

+0

@D_K:檢查進程列表並使用運行solr的命令更新我的問題(參見上文) – PapelPincel

+0

它看起來像,它無法在/ opt/sor/indexes文件夾中找到核心定義,是該文件夾中可用核心的定義? – Rocky

回答

0

運行下面的命令來解決該問題:

sudo chown -R solr:solr /opt/solr/indexes/ 

該目錄是一個附加的體積(亞馬遜EBS)的安裝點。

之前運行的命令,目錄權限看起來像:

$ sudo ls -al /opt/solr/indexes/ 
total 24 
drwxr-x--- 3 solr solr 4096 Feb 26 09:25 . 
drwxr-xr-x 5 solr solr 4096 Feb 26 09:33 .. 
drwx------ 2 solr solr 16384 Feb 26 09:25 lost+found 

我發現這裏唯一的不同就是所有者/組發現失去+:

$ sudo ls -al /opt/solr/indexes/ 
total 24 
drwxr-x--- 3 solr solr 4096 Feb 26 09:25 . 
drwxr-xr-x 5 solr solr 4096 Feb 26 09:33 .. 
drwx------ 2 root root 16384 Feb 26 09:25 lost+found 

運行chown命令後目錄中,我仍然在尋找一個解釋