0
votes

I'm confused about core and collection configuration in Solr.

I've only ever used cores and so I know cores' two main configs are conf/schema.xml and conf/solrconfig.xml

Now I am using solrcloud and think I want to use collections on these cores. I've got a simple two shard, two replica setup like here: http://wiki.apache.org/solr/SolrCloud.

I want to be able to create a new core or collection (via collections api if I can), all the nodes create this core on their own instance and share the same schema.xml and perhaps solrconfig.xml as well.

Thanks for any help

1

1 Answers

0
votes

Got my answer:

  1. Start Zookeeper with: java -Dbootstrap_confdir=./solr/foobar/conf -Dhost=127.0.0.1:9983 -Dcollection.configName=myconf -DzkRun -DnumShards=2 -jar start.jar
  2. Create collection with: http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=foobar&numShards=2&replicationFactor=2

Now each core has the collection foobar with each instance having a core named something like foobar_shard1_replica1, foobar_shard2_replica1,foobar_shard1_replica2, or foobar_shard2_replica2

And to synchronize edit to the configs, you edit the file in that specified confdir and then:

  1. Reload the config using the zkcli upconfig command (I have mine in the cloud-scripts dir): sudo ./zkcli.sh -cmd upconfig -zkhost 127.0.0.1:9983 -confdir ../solr/foobar/conf -confname myconf
  2. Reload the collection using: http://127.0.0.1:8983/solr/admin/collections?action=RELOAD&name=test

Relevant links: http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collections_API https://cwiki.apache.org/confluence/display/solr/Using+ZooKeeper+to+Manage+Configuration+Files https://cwiki.apache.org/confluence/display/solr/Command+Line+Utilities