How to create new core in Solr 5?

2019-03-17 14:06发布

Currently we are using Apache Solr 4.10.3 OR Heliosearch Distribution for Solr [HDS] as a search engine to index our data.

Now after that, I got the news about Apache Solr 5.0.0 release in last month. I'd successfully installed Apache Solr 5.0.0 version and now its running properly on 8983 port (means only running solr but unable to create core). In that UI, I'm unable to find the example core as well as schema or config files under it. So, I started creating new core as we create in old versions but unable to create one. Following is the error, I'm getting it:

Error CREATEing SolrCore 'testcore1': Unable to create core [testcore1] Caused by: Could not find configName for collection testcore1 found:null

Note: I also seen Cloud tab on (ie. http://localhost:8983/solr/) left side of Solr UI and also don't know how it works? Meaning I don't know the location of the schema.xml, solrconfig.xml files due to lack of example folder (Collection1) and how to update those files?

Is there any useful document or solution available to solve this error?

标签: solr lucene core
6条回答
可以哭但决不认输i
2楼-- · 2019-03-17 14:35
{SOLR_INSTALLATION}/server/solr/configsets\basic_configs\conf

you can find the example schema.xml and solrconfig.xml. if you want to create the new core {SOLR_INSTALLATION}/server/solr/{new core name} folder and create conf folder with required schema and solrconfig.xml and blank core.properties file. you can find the examples for schema and config in

{SOLR_INSTALLATION}/example/example-DIH/solr
查看更多
劳资没心,怎么记你
3楼-- · 2019-03-17 14:40

In Solr 5, creation of cores is supported by the bin/solr script provided in the distribution. Try

bin/solr create -help

for a quick introduction.

From the above help doc, you may find:

bin/solr create [-c name] [-d confdir] [-n configName] [-shards #] [-replicationFactor #] [-p port]
查看更多
男人必须洒脱
4楼-- · 2019-03-17 14:42

You can find your solrconfig.xml and schema.xml inside the collection directory. Go to /usr/lib/ambari-infra-solr/server/solr and u will see a folder with same name as of collection and with schema and config files. Inside the conf folder there will be a managed-schema file and other files that you have been searching for.

As for this error Error CREATEing SolrCore 'testcore1': Unable to create core [testcore1] Caused by: Could not find configName for collection testcore1 found:null This error must be coming when you are creating solr collection from UI. For that go to location where solr.cmd is located and type the below code ./solr create -c -d -s -r

查看更多
在下西门庆
5楼-- · 2019-03-17 14:48

Create using the web interface Go to bin directory and issue

   ./solr start -e cloud -noprompt

Which will start solr. Go to http://localhost:8983 (this is assuming you are running on localhost)

Click on core admin and they "Add Core"

查看更多
何必那么认真
6楼-- · 2019-03-17 14:51

Use provided solr script with solr user privileges to create Solr cores, e.g.

cd /opt/solr
sudo -u solr ./bin/solr create -c testcore1

Run bin/solr --help for syntax guidance.

For any other issues, please check your Solr logs (e.g. /var/solr/logs/solr.log).

Related: SOLR-7826: Permission issues when creating cores with bin/solr as root user.

查看更多
干净又极端
7楼-- · 2019-03-17 14:55

In Solr 5.4.0 , create new core using command from Solr-5.x.x folder (Solr Installation folder) like following,

$ bin/solr create -c <name>

See this documentation of Apache Solr 5.4 https://cwiki.apache.org/confluence/display/solr/Running+Solr

查看更多
登录 后发表回答