如何修复:创建SolrCore时出错';开始';:无法创建核心
当我试图在solr中创建一个新内核时,我遇到了这个错误如何修复:创建SolrCore时出错';开始';:无法创建核心,solr,lucene,solr5,Solr,Lucene,Solr5,当我试图在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:8
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
此外,如果我尝试创建替代,它会给我相同的错误:
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管理面板时,它会显示如下通知:
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
快照已附加
您可以通过以下步骤解决此问题:
- /opt/solr/server/gettingstarted/conf/solrconfig.xml
- /opt/solr/server/gettingstarted/conf/schema.xml
- /opt/solr/server/gettingstarted/数据
在我看来可能是用户权限问题。您似乎是以root用户身份运行这些命令,但有些工作是由Solr服务器完成的。服务器进程是否可能是由无法访问错误消息中提到的目录的用户运行的。由于它可能会帮助任何人解决相同的问题,因此它确实是由使用
根目录时引起的。当以root用户身份执行命令时,脚本不会快速终止,而是在失败之前创建一段核心定义
所以首先清理破碎的岩芯:
bin/solr delete -c mycore
确保您的mycore
核心的/var/solr/data
下没有文件夹
接下来将核心创建为solr
用户
su -u solr -c "/opt/solr/bin/solr create_core -c mycore"
这次应该成功了不要以root
用户身份运行solr
脚本(它是)。您应该以solr
用户身份运行,例如:
sudo -u solr ./bin/solr create -c mycore
我发现这是解决方案:
sudo su - solr -c "/opt/solr/bin/solr create -c mycore"
更多信息请点击这里:这对我来说很正常。。。作为solr linux用户创建核心
sudo su - solr -c "/opt/solr/bin/solr create -c mycol1 -n data_driven_schema_configs"
请注意,在创建core之前,应将同名目录放入:
C:\…\solr-8.3.11\server\solr
然后从examples或默认文件夹中复制conf文件夹
我在windows中也遇到了同样的问题
我从示例中复制了conf文件夹:
C:\…\solr-8.3.1\example\files
到这里:
C:\…\solr-8.3.1\server\solr\new\u核心
我的问题解决了
您还可以从其默认文件夹中复制conf文件夹:
C:\…\solr-8.3.11\server\solr\configsets\u默认值
在这里,new\u core是我添加的新核心的名称
所以,也许在Ubuntu中处理这个文件夹可以解决你的问题
下一个解决方案:
在使用命令提示符或终端运行solr后,要创建core,请使用以下命令:
solr create -c new_core_name
我发现您也可以在/var/solr/data/mycore
文件夹上执行chown-R solr
来解决此问题。根据您的安装,solr脚本的路径可能不同。对我来说,这很有效:sudo-usolr/opt/solr-5.3.0/bin/solr create-c[core]
。你找到解决方案了吗?我遇到了完全相同的情况,没有一个答案是有效的,如果您没有找到文件,您可以从configsets/\u default/conf复制它们,并将它们粘贴到core的目录中(我使用的是solr 8)