Solr Error: Unable to create core [mycore] Caused

2019-08-27 22:51发布

问题:

I am trying to create a solr core, I am using drupalvm with vagrant and virtual box.

When setting up solr with this command:

sudo su - solr -c "/opt/solr/bin/solr create -c m4m -d /tmp/search_api_solr/solr-conf/7.x/"

I am getting this error:

INFO  - 2018-11-05 19:21:45.804; org.apache.solr.util.configuration.SSLCredentialProviderFactory; Processing SSL Credential Provider chain: env;sysprop

ERROR: Error CREATEing SolrCore 'mycore': Unable to create core [mycore] Caused by: solr.ICUCollationField

Creating a core without specifying the -d <confdir> option is successful but gives me some really weird errors in the solr dashboard and Drupal UI which research indicates has something to do with a corrupted core.

Any help with why I am getting this error would be much appreciated. Other developers using the same vagrant installation is running without issue.

回答1:

If you create the core without the config directory, solr will use it's default configurations. Which in turn, will have none of the drupal needed field definitions, and so forth. What you need to do, if you know a little bit about the solr's structure, and if you use solr > version 7 is:

  • go to where your solr installation is
  • cd /PATH_TO_SOLR/server/solr-webapp/webapp/WEB-INF/lib
  • Copy all jars from the analysis-extras folder to your wEB-INF/lib folder
  • cp /PATH_TO_SOLR/contrib/analysis-extras/lib/*.jar ./
  • restart solr the way you normally do, specifying your -d config directory. That's important.

Hope this helps. OR... Save your hassle and let the pros handle all this for you with a SaaS such as the likes of https://opensolr.com You can create your solr index with 1 click, and you need 2 more clicks to upload your config files and you're done.