How to Deploy Apache Solr as SolrCloud on HDFS in a Production Cluster

Harsh Jain
Apr 27, 2016 · 6 min read

#Requirements for this guide

#Install Lucidworks-HDPsearch package

yum install lucidworks-hdpsearch

#Notes on Config files for HDFS


#Modifing Config files for HDFS

<directoryFactory name=”DirectoryFactory”
<directoryFactory name=”DirectoryFactory” class=”solr.HdfsDirectoryFactory”>
<str name=”solr.hdfs.home”>hdfs://<host:port>/user/solr</str>
<str name=”solr.hdfs.confdir”>/etc/hadoop/conf</str>
<bool name=”solr.hdfs.blockcache.enabled”>true</bool>
<int name=”solr.hdfs.blockcache.slab.count”>1</int>
<bool name=””>true</bool>
<int name=”solr.hdfs.blockcache.blocksperbank”>16384</int>
<bool name=””>true</bool>
<bool name=”solr.hdfs.nrtcachingdirectory.enable”>true</bool>
<int name=”solr.hdfs.nrtcachingdirectory.maxmergesizemb”>16</int>
<int name=”solr.hdfs.nrtcachingdirectory.maxcachedmb”>192</int>


# Changing to Solr user

Sudo su — solr(input password)

#Starting Solr

bin/solr start -c (1)
-z,, (2)
-Dsolr.directoryFactory=HdfsDirectoryFactory (3)
-Dsolr.lock.type=hdfs (4)
-Dsolr.hdfs.home=hdfs://host:port/path (5)

#Adding nodes to Solr

ssh <nodeName>yum install lucidworks-hdpsearch

#Creating your first collection

bin/solr create -c SolrCollection (1)
-d data_driven_schema_configs (2)
-n mySolrConfigs (3)
-s 2 (4)
-rf 2 (5)

#Verify & Enjoy!


Harsh Jain

Written by

You know, the only thing I’ve never lost -is curiosity. Engr || Entrepreneur. Perpetual Wanderlust. Literary nerd. @themoochapp #BigData #Analytics #Datascience

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade