lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Wright <>
Subject SOLR_HOME vs solr.xml (solrcloud config)
Date Sat, 12 Mar 2016 05:21:23 GMT

Another question regarding documentation of Solr and Zookeeper.

The manual states:

      Solr Hostname

Use the |SOLR_HOST| variable in the include file to set the hostname of 
the Solr server.


Setting the hostname of the Solr server is recommended, especially when 
running in SolrCloud mode, as this determines the address of the node 
when it registers with ZooKeeper.

Yet, in the example solr.xml, the <solrcloud> stanza defines ...


     <str name="host">${host:}</str>
     <int name="hostPort">${jetty.port:8983}</int>
     <str name="hostContext">${hostContext:solr}</str>

     <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>

     <int name="zkClientTimeout">${zkClientTimeout:30000}</int>


More specifically the ${host:} variable. When this variable is filled in 
from startup execution, Zookeeper seems to obtain the correct hostname 
in spite of SOLR_HOST having been set. Yet, the docs recommend setting 
(or additionally setting?) SOLR_HOST with an explicit hostname.

If the <solrcloud> stanza in solr.xml is there to specifically define 
the setup of solrcloud, is it still recommended to define SOLR_HOST 
separately and what benefit does this provide over relying on ${host:} 
in solr.xml? This ${host:} variable at least works without making an 
explicit declaration of an FQDN. At the same time, ${host:} will auto 
populate if the hostname of the box changes. If you hardcode SOLR_HOST 
into a config, this won't dynamically update should the hostname of the 
box change (not that I'm going to run around changing hostnames, but I 
can see how explicitly defining SOLR_HOST could become a problem when 
someone doesn't know that it is defined).

What is the best practice here?



*Brian Wright*
*Sr. Systems Engineer *
901 Mariners Island Blvd Suite 200
San Mateo, CA 94404 USA
*Email * <>
*Phone *+1.650.539.3530**
***** <>*

	Marketo Logo

View raw message