Solr: Adding cores using a configSet in a SolrCloud setup does not work
Asked Answered
P

2

0

I have a SolrCloud (v5.2) setup with 2 different cores [users, docs] working properly.

Now I need to be able to dynamically add new cores that are configuration-wise identical to the docs core that already exists. I don't want to duplicate the configuration (I tried an it works OK) as I need to actually share the synonyms.txt and some other files that constantly change.

I think that I need "configsets" but I cannot get them to work. I uploaded the "template" conf using this command:

sh zkcli.sh -zkhost zk1:2181 -cmd upconfig -confname template -confdir /home/user1/template/conf

And then I tried to create a new core using the template configset like this:

http://solr1:8983/solr/admin/cores?action=CREATE&configSet=template&name=test1

But I get this error:

Error CREATEing SolrCore 'test1': Unable to create core [test1] Caused by: Could not find configName for collection test1 found:[users, docs, template, .system]

I think that I have some missing knowledge on how configsets work.

Punctuation answered 19/4, 2016 at 10:6 Comment(0)
P
0

You can share a configuration for a Core and just create a new Collection. Any changes to the configuration will affect all Collections.

Use this call to create the new Collection:

http://solr1:8983/solr/admin/collections?action=CREATE&name=test1&collection.configName=docs&numShards=1
Punctuation answered 20/4, 2016 at 9:47 Comment(0)
D
0

the default path to directory with configset is $SOLR_HOME/configsets ie in my example is /opt/solr/solr-5.4.0/server/solr/configsets. This path can be configured in solr.xml.

So, if you use the default path for configset then this

sh zkcli.sh -zkhost zk1:2181 -cmd upconfig -confname template -confdir /home/user1/template/conf

should be replaced with

sh zkcli.sh -zkhost zk1:2181 -cmd upconfig -confname template -confdir /home/user1/......../../../configsets

just replace this path /home/user1/......../../../configsets with your correct path for the configsets

Hope this helps

Disbud answered 19/4, 2016 at 11:22 Comment(3)
I tried what you said with the command like this: sh zkcli.sh -zkhost zk1:2181 -cmd upconfig -confname template -confdir /opt/solr/server/solr/configsets but the result is the same. In the /opt/solr/server/solr/configsets folder we have 4 folders (3 defaults and mine): basic_configs data_driven_schema_configs sample_techproducts_configs templatePunctuation
can you try sh zkcli.sh -zkhost zk1:2181 -cmd upconfig -confname template -confdir /opt/solr/server/solr/configsets/template/conf ?Disbud
Same result: "Could not find configName for collection test3 found: ...". I think there is something about letting Solr where the config sets are in ZK that I don't quite get.Punctuation
P
0

You can share a configuration for a Core and just create a new Collection. Any changes to the configuration will affect all Collections.

Use this call to create the new Collection:

http://solr1:8983/solr/admin/collections?action=CREATE&name=test1&collection.configName=docs&numShards=1
Punctuation answered 20/4, 2016 at 9:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.