在Debian 8上安装Solr 5

时间:2015-11-17 21:50:04

标签: solr debian

我按照https://ctors.net/2015/07/14/solr5_java8_debian8上的说明操作。

作为 root

首先我安装了Java 8:

mkdir -p /opt/java

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz"

tar xvf jdk-8u45-linux-x64.tar.gz -C /opt/java
update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_45/bin/java 1
update-alternatives --set java /opt/java/jdk1.8.0_45/bin/java

然后我安装了Solr:

 wget http://apache.belnet.be/lucene/solr/5.2.1/solr-5.2.1.tgz
 tar xvf solr-5.2.1.tgz
 ./solr-5.2.1/bin/install_solr_service.sh solr-5.2.1.tgz

但安装最终会出现以下错误消息:

 solr.service - LSB: Controls Apache Solr as a Service
 Loaded: loaded (/etc/init.d/solr)
 Active: failed (Result: exit-code) since Wed 2015-11-18 02:29:36 TMT; 5s ago
 Process: 1679 ExecStart=/etc/init.d/solr start (code=exited, status=1/FAILURE)

 Nov 18 02:29:36 solrhost su[1681]: Successful su for solr by root
 Nov 18 02:29:36 solrhost su[1681]: + ??? root:solr
 Nov 18 02:29:36 solrhost su[1681]: pam_unix(su:session): session opened for user solr by (uid=0)
 Nov 1`enter code here`8 02:29:36 solruser solr[1679]: This script requires extracting a WAR file with either the jar or unzip utility, please install these utilities or con...assistance.
 Nov 18 02:29:36 solrhost su[1681]: pam_unix(su:session): session closed for user solr
 Nov 18 02:29:36 solrhost systemd[1]: solr.service: control process exited, code=exited status=1
 Nov 18 02:29:36 solrhost systemd[1]: Failed to start LSB: Controls Apache Solr as a Service.
 Nov 18 02:29:36 solrhost systemd[1]: Unit solr.service entered failed state.
 Hint: Some lines were ellipsized, use -l to show in full.
 Service solr installed.

有谁知道发生了什么事?

2 个答案:

答案 0 :(得分:6)

solr需要解压缩才能工作。如果系统上不可用,请安装解压缩。

apt-get install unzip

它应该解决问题。

答案 1 :(得分:1)

我让我的同事看看这个问题。他发现了两个错误原因:

1)内存不足(我的盒子有512 MB RAM内存)。额外的内存解决了这个问题。

2)错误的jdk包,即错误的架构选择。对于不同的JDK包,请在此处查看:http://www.oracle.com/technetwork/java/javase/downloads/java-se-6u24-download-338091.html

希望有一天这会拯救别人的时间和神经。

至于Debian和Solr开发人员,如果您能够提供有关如何在Debian 8下安装Solr 5的简单收据,那就太棒了。例如,https://www.digitalocean.com/community/tutorials/how-to-install-solr-5-2-1-on-ubuntu-14-04