SolrCloud(5.X) with External Zookeeper(3.4.6)

SolrCloud with External Zookeeper,  SETUP and START, STOP Commands

Zookeeper Setup

  1. Download zookeeper:
  1. Unzip. Navigate to the subfolder /conf. Edit the zoo_sample.cfg by including the correct/existing dataDir path and save. Rename it to zoo.cfg
  2. Start zookeeper through shell. Navigate to /bin folder [cd /users/rajani/zookeeper/bin] and start with command - ./ start
  3. Your zookeeper is now started and up. You can cross check it status by using the command - ./ status
  4. Incase, If you would like to connect to zookeeper shell and check out directories existing in it, you can do so by executing the following commands. Navigate to bin and command - ./ -server
  5. You could use ls / command to list the directories available in zoo.  


SolrCloud Setup

  1. Download solr from Apache Solr website[2]
  2. Unzip. First, let’s start solrcloud with the example collection[gettingstarted] created. This helps us to bring up the necessary base required to further create our own custom collection, adding new nodes and etc. To start solrcloud cluster in interactive mode and that pointing to external zookeeper that we have set up above, follow the below commands.
    Navigate to bin, cd /users/rajani/solr_5.2.1/bin/ and ./solr start -e cloud -noprompt -z localhost:2181
  3. This will start solr on ports 8983 and 7574
  4. Connect to solr http://localhost:8983/solr/#/~cloud and confirm the cloud setup
  5. You can now create custom collections on top of this. Command to create a new collection is as follows
  6. First, use ./solr create_collection -help. These help tips will assist you with each param description
  7. ./solr create_collection -c testCollection -n testCollection_Config -d /Users/rajanishivarajmaski1/Lucidworks/SOLR/solr-5.2.1/server/solr/configsets/basic_configs/
  8. repeat step 4


Stop and Start Solr cluster

    1. Now we will stop only solr nodes. Solr node are running on port 8983 and  7574
    2. To stop each node, use the command - ./solr stop -p <portnumber>
      ./solr stop -p 8983
      ./solr stop -p 7574
    3. To stop all the nodes in one command, use ./solr stop -all

    4. Please note that your zookeeper is still up and running. Though solr nodes are stopped.
  1. If zookeeper goes down and solr nodes are still running, then solr nodes will just serve search requests, denying update requests. Its important that zookeeper is always up and running. Therefore dedicated amount of memory and fault tolerant machine should be dedicated to Zookeeper.  Zookeeper acts as a manager to whole cloud setup. If zookeeper is down, cluster itself is down too. So it is always recommended to have a zookeeper quorum in production setup.

  2. You can bring down zookeeper using the command ./ stop

  3. Now if you are willing to bring back the cluster, it is important that you start the Zookeeper first.  Without zookeeper, solr cannot start in cloud mode. If you still don’t pass zookeeper details ‘-z’ param and ask solr to start in cloud mode, it will try to run on its embedded zookeeper.

  4. Pass on the running zookeeper details [-z localhost:2181] and start each node. To start back, commands are

  1. Start zookeeper - ./ start [assuming that this is running on same port - 2181]
  2. Start each solr node
    ./solr start -cloud -s /Users/rajani/solr-5.2.1/example/cloud/node1/solr -p 8983 -z localhost:2181 -m 512m
    ./solr start -cloud -s /Users/rajani/solr-5.2.1/example/cloud/node2/solr -p 7574 -z localhost:2181 -m 512m

Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk