0

Essentially, I'm attempting to spin up a single Solr service (v5.5) via Lando. The problem I'm running into is that Lando only supports the configuration of a single core, but it does support the use of a custom Solr config file.

Is it possible to modify the solrconfig.xml file to force the creation of two, custom cores? Here's what I have attempted below which doesn't seem to work.

Is this even possible to do in v5.5? With how this needs to be implemented, I cannot use the CREATE API (ex: http://localhost:8983/solr/admin/cores?action=CREATE&name=test_core&...) to programmatically create new cores which is why I'm heading down this particular path.

<solr>

  <solrcloud>

    <str name="host">${host:}</str>
    <int name="hostPort">${jetty.port:8983}</int>
    <str name="hostContext">${hostContext:solr}</str>

    <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>

    <int name="zkClientTimeout">${zkClientTimeout:30000}</int>
    <int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int>
    <int name="distribUpdateConnTimeout">${distribUpdateConnTimeout:60000}</int>

  </solrcloud>

  <shardHandlerFactory name="shardHandlerFactory"
    class="HttpShardHandlerFactory">
    <int name="socketTimeout">${socketTimeout:600000}</int>
    <int name="connTimeout">${connTimeout:60000}</int>
  </shardHandlerFactory>

  <cores adminPath="/admin/cores">
    <core name="core0" instanceDir="core">
      <property name="dataDir" value="/data/core0" />
    </core>
    <core name="core1" instanceDir="core">
      <property name="dataDir" value="/data/core1" />
    </core>
  </cores> 

</solr>
ianpoley
  • 552
  • 2
  • 10
  • 20
  • `solrconfig.xml` is part of the configuration for each core or collection, and thus, can't define multiple cores by itself (as far as I know). Are you sure you can't just define multiple entries as `type: solrX.X` in the `services` section of your yml configuration file for Lando? (but that would give you multiple instances of jetty/the container, sure) – MatsLindh Jul 24 '18 at 18:15
  • @MatsLindh - yeah, we absolutely need both cores to be created inside the same, single Solr service. Having two services would mean we have two, separate URLs which won't work for our needs. – ianpoley Jul 24 '18 at 18:33
  • Since Lando uses the regular docker-solr images, take a look at [docker-solr](https://github.com/docker-solr/docker-solr)'s way of creating cores - if you can attach a `create_core` command through `docker exec` or something similar in the yml file, that could be an option (this is also what the solr.js service descriptor in Lando does through `solr-precreate`). – MatsLindh Jul 24 '18 at 18:46

0 Answers0