如何修复:创建 SolrCore 'gettingstarted' 时出错:无法创建核心 [英] How to fix: Error CREATEing SolrCore 'gettingstarted': Unable to create core

查看:19
本文介绍了如何修复:创建 SolrCore 'gettingstarted' 时出错:无法创建核心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 solr 中创建新内核时出现此错误.

I'm getting this error when I try to create a new core in solr.

root@ubuntu:/opt/solr# bin/solr create -c gettingstarted -n data_driven_schema_configs

Setup new core instance directory:
/var/solr/data/gettingstarted

Creating new core 'gettingstarted' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=gettingstarted&instanceDir=gettingstarted

Failed to create core 'gettingstarted' due to: Error CREATEing SolrCore 'gettingstarted': Unable to create core [gettingstarted] Caused by: /var/solr/data/gettingstarted/data

另外,如果我尝试创建替代,它会给我同样的错误:

Also, if I try to create alternatively, It gives me same error:

root@ubuntu:/opt/solr# bin/solr create -c mycore

Setup new core instance directory:
/var/solr/data/mycore

Creating new core 'mycore' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=mycore&instanceDir=mycore

Failed to create core 'mycore' due to: Error CREATEing SolrCore 'mycore': Unable to create core [mycore] Caused by: /var/solr/data/mycore/data

在浏览器中,当我尝试访问 solr 管理面板时,它会显示如下通知:

In browser, when I try to access solr admin panel, it displays a notification like:

SolrCore Initialization Failures

opt/solr/example/exampledocs/*.xml: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: /var/solr/data/opt/solr/example/exampledocs/*.xml/data 

附上快照.

推荐答案

既然它可以帮助任何有同样问题的人,它确实是由 使用 root 时的权限问题.以 root 身份执行命令时,脚本不会快速终止,而是在失败之前创建一段核心定义.

Since it might help anybody with the same issue, it's indeed caused by permission issues when using root. The script doesn't terminate quickly when executing the command as root and instead creates a piece of the core definition before failing.

所以首先清理损坏的核心:

So first cleanup the broken core:

bin/solr delete -c mycore

确保您的 mycore 核心的 /var/solr/data 下没有任何文件夹.

Make sure that no folder(s) linger under /var/solr/data for your mycore core.

接下来以 solr 用户身份创建核心

Next create the core as the solr user

su -u solr -c "/opt/solr/bin/solr create_core -c mycore"

这次应该成功了

这篇关于如何修复:创建 SolrCore 'gettingstarted' 时出错:无法创建核心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆