solr安装,无法启动示例 [英] solr installation, cannot start examples
问题描述
首先:我想学习solr.因此,我想从 http://lucene.apache.org/solr/quickstart执行快速入门教程.html
First: I want to learn solr. So I want to execute the quickstart tutorial from http://lucene.apache.org/solr/quickstart.html
在ubuntu 14.04 64位上,我通过以下方式安装了solr:
On ubuntu 14.04 64 bit I installed solr the following way:
在每个wget的/opt中,我采用了最新版本6.3.0.这是根用户创建的.
In /opt per wget I took the latest version 6.3.0. This was made as root.
然后我提取服务安装文件为
Then I extracted the service installation file by
tar xzf solr-6.3.0.tgz solr-6.3.0/bin/install_solr_service.sh --strip-components=2
也可以是root!
我让它运行
sudo ./install_solr_service.sh solr-6.3.0.tgz
导致用户/组solr的
,将solr作为服务启动,从/opt/solr到/opt/solr-6.3.0进行符号链接,以solr.home到/var/solr并以用户solr作为所有者,等等.
that led to user/group solr, started solr as a service, made a symlink from /opt/solr to /opt/solr-6.3.0, made solr.home to /var/solr with user solr as owner etc.
Solr已按预期启动,因此 http://localhost:8983/solr/#/在浏览器中显示破折号.
Solr is started as expected so http://localhost:8983/solr/#/ shows me the dash in the browser.
我按通常的命令停下来
service solr stop
启动示例的服务.
这里是问题:
当我以root身份启动时:
When I start as root:
root@duke:/opt/solr# bin/solr start -e cloud -noprompt
结果在这里:
欢迎使用SolrCloud示例!
"Welcome to the SolrCloud example!
为示例SolrCloud集群启动2个Solr节点.
Starting up 2 Solr nodes for your example SolrCloud cluster.
Solr主目录/opt/solr/example/cloud/node1/solr已经存在. /opt/solr/example/cloud/node2已经存在.
Solr home directory /opt/solr/example/cloud/node1/solr already exists. /opt/solr/example/cloud/node2 already exists.
使用以下命令在端口8983上启动Solr: /opt/solr/bin/solr start -cloud -p 8983 -s"/opt/solr/example/cloud/node1/solr"
Starting up Solr on port 8983 using command: /opt/solr/bin/solr start -cloud -p 8983 -s "/opt/solr/example/cloud/node1/solr"
警告:以root用户身份启动Solr存在安全风险,因此不被视为最佳实践.正在退出. 请查阅参考指南.要覆盖此检查,请从参数"-force"开始
WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting. Please consult the Reference Guide. To override this check, start with argument '-force'
错误:进程退出并出现错误:1(退出值:1)"
ERROR: Process exited with an error: 1 (Exit value: 1)"
所以root不是正确的所有者,据我了解,因为创建了新的用户Solr.
So root is not the correct owner, which I understand because there is a new user solr created.
然后我以用户身份更改为solr来启动示例:
Then I change to solr as user to start the examples:
solr@duke:/opt/solr$ bin/solr start -e cloud -noprompt
欢迎使用SolrCloud示例!
"Welcome to the SolrCloud example!
为示例SolrCloud集群启动2个Solr节点.
Starting up 2 Solr nodes for your example SolrCloud cluster.
创建Solr主目录/opt/solr/example/cloud/node1/solr
Creating Solr home directory /opt/solr/example/cloud/node1/solr
错误:无法创建目标目录'/opt/solr/example/cloud/node1/solr'
ERROR: Destination '/opt/solr/example/cloud/node1/solr' directory cannot be created"
因此,第一个以root用户身份进行的测试由于solr而没有授予我权限,而第二个以solr用户身份进行的测试则没有给予我创建目录/文件的权限.
So the first test as root give me no permission because of solr and the second one as user solr give me no permission to create directories/files.
该怎么办?
推荐答案
以Solr用户身份运行时,必须授予solr
用户访问您尝试编写目录的目录的权限配置.如果这是/opt/solr
,则可以通过发出 chown
命令:
When you're running as the Solr user, you'll have to give the solr
user access to the directory where you're trying to write your configuration. If this is /opt/solr
, you can change the owner of the directory and all contained files recursively by issuing a chown
command:
chown -R solr.solr /opt/solr
这假设您的系统上还有一个名为solr
的组.如果没有solr组,请使用另一个合适的组,或者将最后一个.solr
保留在命令之外.
This assumes that there's also a group named solr
on your system. If you don't have a solr group, either use another, suitable group, or leave the last .solr
out of the command.
这篇关于solr安装,无法启动示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!