How to fix: Error CREATEing SolrCore 'gettingstarted': Unable to create core

那年仲夏 提交于 2019-12-02 21:35:55
3xil3

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

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

Next create the core as the solr user

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

This time it should succeed

Don't run solr script as root user (it is not recommended). You should run as solr user, e.g.:

sudo -u solr ./bin/solr create -c mycore

I found this as the solution:

sudo su - solr -c "/opt/solr/bin/solr create -c mycore"

More information here: https://www.howtoforge.com/tutorial/how-to-install-and-configure-solr-on-ubuntu-1604/

You can solve the problem with the following steps:

  1. Check whether the directories with the right files are exist:

    • /opt/solr/server/gettingstarted/conf/solrconfig.xml
    • /opt/solr/server/gettingstarted/conf/schema.xml
    • /opt/solr/server/gettingstarted/data
  2. then open the Core Admin, "Add new core", enter the right directory/file names and add the core to the system. Actually it will give you an error message that the core already exists. Refresh the admin webpage in the browser and it will automatically load this core now without any error message.

Looks to me like a possible user permission issue. You seem to be running the commands as root, but some of the work is done by the Solr server. Is it possible that the server process is run with a user that does not have access to the directories mentioned in the error message.

this works normally with me... creating cores as the solr linux user.

sudo su - solr -c "/opt/solr/bin/solr create -c mycol1 -n data_driven_schema_configs"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!