Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to start solr in clustering mode

How to start solr in clustering mode

New Contributor



   We have cloudera 5.11 with solr 4.10 version. I want start the SOLR in clustering mode so I could make use of carrot2 integration and cluster the result  set. I have set the Dsolr.clustering.enabled=True in Java Configuaration Options for Solr Server. 



I can see the change in CATALINA_OPTS too as below. But when I restart the SOLR server it fails with the error saying "Unrecognized VM option 'CMSParallelRemarkEnabled-XX:Dsolr.clustering.enabled=true'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit." -Dsolr.hdfs.blockcache.enabled=true -Dsolr.hdfs.blockcache.blocksperbank=16384 -Dsolr.hdfs.blockcache.slab.count=1 -DzkClientTimeout=15000 -Xms209715200 -Xmx209715200 -XX:MaxDirectMemorySize=268435456 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled-XX:Dsolr.clustering.enabled=true -XX:OnOutOfMemoryError={{AGENT_COMMON_DIR}}/


Can you please guide me on how to start the SOLR with clustering enabled.





Re: How to start solr in clustering mode

Super Collaborator

Solr clustering is enabled by default, you don't need to make any changes to enable it.



Re: How to start solr in clustering mode

New Contributor

Thanks for the reply. How do I know if clustering is enabled and if it using Carrot2 libraries for resultset clustering.



Re: How to start solr in clustering mode

New Contributor

CLustering in solr is not working by default. What config changes need to be made? when I try below url, I see an error. 


  http://<ip address>:8983/solr/knowledgebase/clustering?q=*:*&wt=json


HTTP Status 404 - /solr/knowledgebase/clustering


The requested resource is not available.





Re: How to start solr in clustering mode

New Contributor

Its enabled by default, not need to make a change.

If you've used CM to install the solr service on the other cluster machines, auto-configs are done by the CM and zookeeper will be aware of these servers



1. generate solr configs(schema.xml and solrconfig.xml) as instructed in the documentation, and customize according to schema

2. Make the files available to Solr, upload the contents of the config (instanceDir) to zookeeper

3. Then create the collection and specify the number of shards, these shouldn't exceed the number of solr servers


Go to solr admin page of any of the nodes, check under Cloud, you should be able to view some sort of mapping

 collection_name -> shard <number> -> node_hostname

Don't have an account?
Coming from Hortonworks? Activate your account here