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

混江龙づ霸主 提交于 2019-12-10 12:12:50

问题


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.


回答1:


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




回答2:


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


来源:https://stackoverflow.com/questions/36715193/solr-adding-cores-using-a-configset-in-a-solrcloud-setup-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!