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

后端 未结 7 1980
时光说笑
时光说笑 2021-02-01 05:44

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 n         


        
相关标签:
7条回答
  • 2021-02-01 05:44

    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"
    
    0 讨论(0)
  • 2021-02-01 05:45

    Please notice that before creating a core you should make a directory with the same name into :

    C:\...\solr-8.3.11\server\solr

    Then copy conf folder from examples or the default folder.

    I had a same problem in windows I copied conf folder from examples:

    C:\...\solr-8.3.1\example\files

    to here :

    C:\...\solr-8.3.1\server\solr\new_core

    And my problem solved.

    You can also copy conf folder from its default folder:

    C:\...\solr-8.3.11\server\solr\configsets_default

    in here new_core is the name of my new core which I was adding.

    so maybe in Ubuntu coping this folder solve your problem.

    next solution : after running solr with command prompt or the terminal, to create a core use this command :

    solr create -c new_core_name
    
    0 讨论(0)
  • 2021-02-01 05:49

    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

    0 讨论(0)
  • 2021-02-01 05:51

    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.

    0 讨论(0)
  • 2021-02-01 06:03

    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
    
    0 讨论(0)
  • 2021-02-01 06:08

    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/

    0 讨论(0)
提交回复
热议问题