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.

s1m3n
  • 623
  • 6
  • 21

2 Answers2

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

Periklis Douvitsas
  • 2,431
  • 1
  • 13
  • 14
  • 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 template – s1m3n Apr 19 '16 at 12:05
  • can you try sh zkcli.sh -zkhost zk1:2181 -cmd upconfig -confname template -confdir /opt/solr/server/solr/configsets/template/conf ? – Periklis Douvitsas Apr 19 '16 at 15:21
  • 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. – s1m3n Apr 20 '16 at 09:01
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
s1m3n
  • 623
  • 6
  • 21