A quick local SolrCloud for Sitecore as container

 Why?

About a year ago I posted a blog post describing how to get the SolrCloud with integrated Zookeeper running on Windows machine quickly.
That is useful if you need to quickly get a SolrCloud for your Sitecore deployment.

Recently I needed exactly this one to get my local Sitecore environment running. But I got some strange behavior that wasted my time when I was trying to troubleshoot and understand why I can't get local SoltCloud running.
I was not able to start SolrCloud. I tried that on several VMs (including my working laptop) with no success. I don't know why. Well, it was working on my laptop several months ago...




The time I spent messing around with Windows Firewall, different Solr Versions and trying to specify particular Zookeeper Client port just in order to start the simplest SolCloud locally made me look for a more reliable way of running that.
That is to use containers...

How?

So, I started searching.
Actually, there is a great Solr on Docker repository and Docker images but due to some reason I was not able to get Solr 8.1.1 (I needed that particular version which is supported by Sitecore 9.3) working in Cloud mode. The images and all functionalities seemed too complex to me. I just didn't need all that functionality and power.

My goal was to get the simplest SolrCloud with an integrated Zookeeper and one Solr Node that can run HTTPS and be able to persist collections (if I decide to stop containers, restart my host machine, etc.)

I went the way creating a self-made Solr image.

My solution


The repo contains readme.md with a good explanation how to get started with it.

I used openjdk:11-jre image as base image. See the Dockerfile below:

The entry point for the container is the custom shell script that has 2 commands:
  • First - to instruct Zookeeper that Solr Node is going to use HTTPS
  • Second - to start Solr node with integrated Zookeeper and point it to the specific folder

Conclusion


The goal for this image is to get simplest SolrCloud with one Node that is easy and quick to create.
Obviously, this solution is not for production-like payloads. This is something that dev folks may need to quickly use for test.

Comments