SolrCloud Setup on single machine

SolrCloud is the name of a set of new distributed capabilities in Solr. Passing parameters to enable these capabilities will enable you to set up a highly available, fault tolerant cluster of Solr servers. Use SolrCloud when you want high scale, fault tolerant, distributed indexing and search capabilities.

A little about SolrCores and Collections

On a single instance, Solr has something called a SolrCore that is essentially a single index. If you want multiple indexes, you create multiple SolrCores. With SolrCloud, a single index can span multiple Solr instances. This means that a single index can be made up of multiple SolrCore‘s on different machines. We call all of these SolrCores that make up one logical index a collection. A collection is a essentially a single index that spans many SolrCore‘s, both for index scaling as well as redundancy. If you wanted to move your 2 SolrCore Solr setup to SolrCloud, you would have 2 collections, each made up of multiple individual SolrCores.

Steps to install SolrCloud :

  1. Download solr-4.10.0 from and unzip it.
  2. The process of creating a cluster consisting of two solr servers representing two different shards of a collection :

  1. Since we’ll need two solr servers for this, simply make a copy of the unzip solr folder for the second server — making sure you don’t have any data already indexed.

            In command prompt go to example folder and then –

               cp –r solr4.10.0 solr2 
  1. Go to example folder of first solr1 server in command prompt.
              cd example
  1. Now enter the command starts up a Solr server and bootstraps a new solr cluster.
 java -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DzkRun  -DnumShards=2 -jar start.jar 

-Dbootstrap_confdir : path to configuration directory. Can be set according to location of the conf   folder.
-Dcollection.configName : name of conf folder on zookeeper.
-DnumShards : number of shards.

  1. Browse to http://localhost:8983/solr/#/~cloud to see the state of the cluster
  2. Then start the second server, pointing it at the cluster 

Go to example folder of solr2 server:

cd example2
java -Djetty.port=7574 -DzkHost=localhost:9983 -jar start.jar
  1. You can see how your collection is deployed across the cluster by visiting the cloud panel in the Solr Admin UI: http://localhost:8983/solr/#/~cloud
  1. To check health of cluster :
    solr healthcheck -c collection name



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s