Solrcloud With Zookeeper -Single server setup
Getting Started with SolrCloud: A Beginner’s Guide for First-Time Users
If you’ve been diving into search technology and stumbled across SolrCloud, you might think it’s just Apache Solr hosted in the cloud. That’s a common misconception—but SolrCloud is much more powerful than that.
In this beginner-friendly guide, we’ll walk you through what SolrCloud actually is, why you might need it, and how to get it up and running on your local machine for development or testing.
What is SolrCloud (and Why Should You Care)?
SolrCloud is the distributed, fault-tolerant, and scalable evolution of Apache Solr’s traditional architecture. While the original Solr relied on a master-slave model, SolrCloud is built for modern, large-scale applications that require high availability and real-time indexing.
Key Benefits of SolrCloud:
-
High Availability: Replication ensures your data is always accessible—even if some nodes go down.
-
Scalability: Easily add new nodes as your indexing needs grow.
-
ZooKeeper Coordination: Handles configuration, failover, and cluster state management seamlessly.
Tools & Versions Used in This Guide
To get started, you’ll need the following software :
-
Java: 11.0.25
-
ZooKeeper: 3.5.7
-
Apache Solr: 8.11.2
For a local setup, we’ll be simulating a cluster using three ZooKeeper nodes and two Solr nodes—all on one machine.
Note: In production, always use an odd number of ZooKeeper nodes to ensure quorum.
Step-by-Step SolrCloud Setup on Windows
1. Install Java (OpenJDK 11)
-
Download and install Java 11.
-
Set your
JAVA_HOMEenvironment variable correctly.
2. Install NSSM (Non-Sucking Service Manager)
NSSM helps run Solr and ZooKeeper as Windows services.
-
Download NSSM from nssm.cc
-
Extract it to a directory of your choice
3. Set Up ZooKeeper Cluster (3 Nodes)
đ Folder Structure
Create a directory structure like this:
Copy the extract Zookeeper 3.5.7 files into zookeeper-1 folder, then copy it twice and rename the copies to zookeeper-2 and zookeeper-3.Please check the screenshot mentioned below for better understanding.
4. Configure ZooKeeper Nodes
Step 1: Update zoo.cfg
Inside each node’s conf directory, copy zoo_sample.cfg → rename it to zoo.cfg. Then edit with node-specific values. For example, for zookeeper-1:
Note: update clientport and datadir value specific to each node. Its always good to have separate client ports for each zookeeper node
The clientPort is the port on which Solr accesses ZooKeeper (default is 2181).
The parameters server.1, server.2, server.3, etc., are part of the Ensemble Configuration. These settings are necessary so that each node in the ensemble knows its own identity and the addresses of the other nodes.
In our case, the Ensemble Configuration is specified using hostnames in the configuration file. However, you can also configure it using IP addresses if preferred.
The ports used for communication between ZooKeeper nodes can be any ports you choose, but the default ports are 2888 (for follower connections) and 3888 (for leader election).
.
Step 2: Assign Node IDs
In each node’s dataDir, create a file named myid (no extension) and insert the corresponding number.Please check the screenshot mentioned below for better undersatnding
-
zookeeper-1→ 1 -
zookeeper-2→ 2 -
zookeeper-3→ 3
Step 3: Open Firewall Ports
Allow ports 2181, 2182, and 2183 in Windows Firewall .In local dev environment I hope you do not need to worry as it worked for me.
You can test connectivity with PowerShell:
5. Start ZooKeeper Using NSSM
Navigate to the NSSM executable directory in cmd proppt as admin:
Point the path variable to the zkServer.cmd script for each ZooKeeper node. After installing all three nodes, restart your system and check Windows Services to ensure they’re running.
Note: If you have completed the setup of only one ZooKeeper node and try to run it as a Windows service, it will not work. At least two out of three nodes must be running at the same time to form a majority quorum. First-time users often get stuck here, thinking there's an issue with the setup. So, make sure to install all three nodes as Windows services and then restart your system..
Setting Up SolrCloud with Standalone Solr:
In the context of this blog, I have two standalone Solr instances running on port numbers 8983 and 8985. Both are sharing the same self-signed certificate, and the domain is set to localhost. Since both Solr instances are running on localhost, they are able to use the same certificate. I’m assuming you’re already familiar with how to set up a standalone Solr instance with HTTPS enabled.
1. Configure solr.in.cmd in both the solr instance node
Update the ZK_HOST variable in each Solr node’s solr.in.cmd:
Then restart the Solr services.
2. Enable SSL for ZooKeeper Ensemble
On one of your Solr servers, run the following command to set https as the cluster's URL scheme:
3. Access Solr Admin UI
Head over to:
You should see your SolrCloud cluster up and running, including nodes, shards, and ZooKeeper details.
Creating Solr Collections
Now we are done with solr cloud setup with zookeeper. Now to create collection .Please refer to Sitecore documentation which is very simple.
Useful Reading & Next Steps
-
[Sitecore SolrCloud Setup Guide]
-
[xConnect with SolrCloud]





.jpg)
Comments
Post a Comment