solrapache-zookeepersolrjsolrcloudsolrconfig

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


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.


Solution

  • 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