How to create new core in Solr 5?
Asked Answered
L

7

20

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?

Lucaslucca answered 16/3, 2015 at 6:6 Comment(0)
H
27

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]
Harve answered 16/3, 2015 at 13:21 Comment(6)
Thanks. Now core is created but I'm unable to see schema.config file in that directory. How to update my existing file with newer one?? Also I don't know about cloud in solr UI??Lucaslucca
I'm unable to find that files on your provided path in solr5. Have you checked solr5?Lucaslucca
{SOLR_INSTALLATION}/server/webapps/solr/{CORE_NAME}/conf/ Correction*Harve
still not able to get the files. Actually, I see the solr.war file at {SOLR_INSTALLATION}/server/webapps/ location. That is no "solr" folder exists at {SOLR_INSTALLATION}/server/webapps/.Lucaslucca
You can also check the path in UI. localhost:[PORT]/solr/[CORE] should reflect the location of the core.Harve
solr create [-c name] this command only worked for me. Thanks!Lucaslucca
T
10

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

Thracophrygian answered 5/2, 2016 at 9:28 Comment(1)
It is showing following error : ERROR: C:\solr\server\solr\configsets not found!Dosimeter
T
5
{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
Trimurti answered 3/7, 2015 at 14:9 Comment(0)
J
3

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"

Jactitation answered 13/8, 2015 at 9:37 Comment(0)
S
0

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.

Spotted answered 26/3, 2017 at 18:10 Comment(0)
G
0

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

Greylag answered 14/8, 2018 at 12:38 Comment(0)
C
0

copy conf from solr/example/conf to solr/server/solr/.

Carlos answered 7/2, 2022 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.