solr 在ubuntu上配置

需要把solr服务器安装到linux环境:
第一步:安装linux、jdk、tomcat。
[root@bogon ~]# ll
total 8044
-rw-r–r–. 1 root root 8234674 Oct 27 2013 apache-tomcat-7.0.47.tar.gz
[root@bogon ~]# tar -zxf apache-tomcat-7.0.47.tar.gz
[root@bogon ~]# ll
total 8048
drwxr-xr-x. 9 root root 4096 Sep 10 17:55 apache-tomcat-7.0.47
-rw-r–r–. 1 root root 8234674 Oct 27 2013 apache-tomcat-7.0.47.tar.gz
[root@bogon ~]# mkdir /usr/local/solr
[root@bogon ~]# cp apache-tomcat-7.0.47 /usr/local/solr/tomcat
cp: omitting directory `apache-tomcat-7.0.47’
[root@bogon ~]# cp apache-tomcat-7.0.47 /usr/local/solr/tomcat -r
[root@bogon ~]# cd /usr/local/solr/
[root@bogon solr]# ll
total 4
drwxr-xr-x. 9 root root 4096 Sep 10 17:56 tomcat
[root@bogon solr]#
第二步:把solr的压缩包上传到服务器。并解压。
第三步:把/root/solr-4.10.3/dist/solr-4.10.3.war包部署到tomcat下。并改名为solr.war
[root@bogon dist]# cp solr-4.10.3.war /usr/local/solr/tomcat/webapps/solr.war
第四步:解压war包。启动tomcat自动解压。关闭tomcat。删除solr.war.
第五步:把/root/solr-4.10.3/example/lib/ext 目录下所有的jar包复制到solr工程中。
[root@bogon ext]# cp * /usr/local/solr/tomcat/webapps/solr/WEB-INF/lib/
第六步:创建solrhome。Solrhome是存放solr服务器所有配置文件的目录。
[root@bogon example]# pwd
/root/solr-4.10.3/example
[root@bogon example]# cp -r solr /usr/local/solr/solrhome
[root@bogon example]#
第七步:告诉solr服务器solrhome的位置。
需要修改solr工程的web.xml文件。
solr 在ubuntu上配置_第1张图片

配置好后出现问题
HTTP Status 500 - {msg=SolrCore ‘collection1’ is not available due to init failure: Error opening new searcher,trace=org.apache.solr.common.SolrException: SolrCore ‘collection1’ is not available due to init failure: Error opening new searcher at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:745) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:307) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol AbstractConnectionHandler.process(AbstractProtocol.java:611)atorg.apache.tomcat.util.net.JIoEndpoint SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor Worker.run(ThreadPoolExecutor.java:615)atorg.apache.tomcat.util.threads.TaskThread WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.solr.common.SolrException: Error opening new searcher at org.apache.solr.core.SolrCore.(SolrCore.java:881) at org.apache.solr.core.SolrCore.(SolrCore.java:654) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:491) at org.apache.solr.core.CoreContainer 1.call(CoreContainer.java:255)atorg.apache.solr.core.CoreContainer 1.call(CoreContainer.java:249) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) … 1 more Caused by: org.apache.solr.common.SolrException: Error opening new searcher at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1574) at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1686) at org.apache.solr.core.SolrCore.(SolrCore.java:853) … 8 more Caused by: java.nio.file.AccessDeniedException: /var/lib/tomcat7/webapps/solr/solrhome/collection1/data/index/write.lock at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177) at java.nio.channels.FileChannel.open(FileChannel.java:287) at java.nio.channels.FileChannel.open(FileChannel.java:334) at org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:167) at org.apache.lucene.store.Lock.obtain(Lock.java:77) at org.apache.lucene.index.IndexWriter.(IndexWriter.java:753) at org.apache.solr.update.SolrIndexWriter.(SolrIndexWriter.java:77) at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:64) at org.apache.solr.update.DefaultSolrCoreState.createMainIndexWriter(DefaultSolrCoreState.java:279) at org.apache.solr.update.DefaultSolrCoreState.getIndexWriter(DefaultSolrCoreState.java:111) at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1537) … 10 more ,code=500}

需要分配权限

**sudo chown -R xiamo /var/lib/tomcat7/webapps/**

你可能感兴趣的:(solr 在ubuntu上配置)