One specific requirement when configuring SolrCloud is to have a single URL that is scaled to a minimum of the Solr instances. Each instance is configured to run in SolrCloud mode (Ensemble, aka Quorum). In order to accomplish SolrCloud a set of Zookeepers are needed.
What are Zookeepers and why are the needed?
A Zookeeper service is a centralised open-source server for maintaining and managing configuration information, naming conventions and synchronisation for distributed cluster environments. A Zookeeper helps the distributed systems reduce their management complexity by providing low latency and high availability. A minimum of three Solr instances are needed. This is because for a Zookeeper service to be active there must be a majority of non-failing machines with the ability of communicating with each other.
To create a deployment that can tolerate the failure of F machines, you should count on deploying 2xF+1 machines.
- A deployment with three machines can handle one failure
- A deployment with five machines can handle two failures
- A deployment with six machines can only handle two failures as three machines isn’t a majority
Multiple Solr instances and Zookeepers running on the same machine is fine. But what about load balancing?
The vanilla gobetween configuration has 'commented out' settings, but they can be simplified. For example:
The most relevant part is:
In the above example the text servers.sample has been changed to servers.solrcloud for the server group, although the original value can be left if desired.
Port 3010 is being used for the load balancer and the Solr instances are running in the consecutive ports 9000, 9001, 9002. You can leave the defaults of 8983, 8984, 8985 but as the default is being used by another instance, the consecutive ports 9000, 9001, 9002 are being used.
NSSM is being used to register Solr, Zookeepers and gobetween services:
Below is an example of the command for the gobetween service installation:
- Path: d:\gobetween\solrcloud.[DOMAIN]\gobetween-0.7.0\gobetween.exe
- Startup Directory: d:\gobetween\solrcloud.[DOMAIN]\gobetween-0.7.0
- Arguments: d:\gobetween\solrcloud.[DOMAIN]\gobetween-0.7.0\config\gobetween.toml
It’s important to note, not to try to create your own gobetween.toml with a different name and try to run that file instead because that won’t work.
Example of directly using the gobetween port.
If you want to remove port 3010 and use 443 instead, but IIS is using and listening on the 443 port, enable the reverse proxy in IIS by installing the URL Rewrite v2 and the Application Request Routing 3.0 modules. Use Microsoft Web Platform Installer to get these.
To setup the IIS URL Rewrite Reverse Proxy disable the Enable SSL Offloading, However, if you have SSL enabled for the SolrCloud configuration on HTTP then leave it on and add the certificate on the IIS websites instead of Solr. It’s highly recommended that you configure all your services with HTTPS when possible.
Example of directly using IIS URL Rewrite Reverse Proxy
At Codehouse our development team has years of experience of working on Sitecore projects. Many of these projects require complex and expert development skills to deliver stable, scalable and robust environments for digital platforms.