Solr hosted on Azure

  • Create a zip containing coreconfig folder Azure Container

  • Host zip file on secure location for solr create script to use it for core configuration on startup. These should be accessible publicly.

  • Host sqljdbc822.jar file on same location. These should be accessible publicly.

  • Update db-data-config.xml file with your sql server credentials.

  • They are now accessible at:

    http:// link-to-your-own-configset/configsets.zip -o
    /opt/solr/server/solr/configsets/configsets.zip && wget -nc http:// link-to-your-own-configset/sqljdbc822.jar -O /opt/solr/server/solr/configsets/sqljdbc822.jar

Create New Container App Service for Linux Container

Web App

Web App Details

  • Enable App Service Storage

Storage Service

  • Added two File Share in storage

File Store

  • Mount Storage in Container

Mount Storage

  • Update docker-compose settings with mount storage
version: '3'
services:
  solr:
    image: solr:8.1.1
    volumes:
      - solrconfigset:/opt/solr/server/solr/configsets
      - solrdata:/var/solr/data
    command:
      - bash
      - '-c'
      - >
        curl http://link-to-your-own-configset/configsets.zip -o /opt/solr/server/solr/configsets/configsets.zip &&
        wget -nc http://link-to-your-own-configset/sqljdbc822.jar -O /opt/solr/server/solr/configsets/sqljdbc822.jar || true &&
        unzip -o /opt/solr/server/solr/configsets/configsets.zip -d /opt/solr/server/solr/configsets &&
        precreate-core mycore2 /opt/solr/server/solr/configsets/nopaccelerate_core_config &&
        solr-foreground

solr home

Storage Account

Storage Account Container

- This ensure that data is stored and persisted when container is restarted or recreated / across containers when scaled.
  • You can check error log here:

Error Logs

  • Once Solr is up and Solr core is created, we need to update the docker config file (docker-compose.yml) to remove startup script to prevent it to download/extract coreconfig and create core. Because of this script, the existing core configs were being over-written in Azure storage causing the Solr to be unstable and eventually stop with java servlet error.

    • To prevent this, we just need to update the config file like this.
version: '3'
services:
  solr:
    image: solr:8.1.1
    volumes:
      - solrconfigset:/opt/solr/server/solr/configsets
      - solrdata:/var/solr/data

Solr Docker

← Previous | Next →