On 3/11/2016 10:21 PM, Brian Wright wrote: > Use the |SOLR_HOST|variable in the include file to set the hostname of > the Solr server. > |SOLR_HOST=solr1.example.com| > > 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 ... > > <solrcloud> > > <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> > <int > name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int> > <int > name="distribUpdateConnTimeout">${distribUpdateConnTimeout:60000}</int> > > </solrcloud> > > > 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.
The SOLR_HOST environment variable is used by the startup shell script (I looked at 5.4.0, the Windows start script has a command that accomplishes the same thing) -- setting the Java system property named "host": SOLR_HOST_ARG=("-Dhost=$SOLR_HOST") The solr.xml file contains ${host:} which tells it to use that java property. The colon in the property name determines the value if the property is not available -- blank in this case . A blank value for the "host" setting in solr.xml means that Solr will use its default -- the first IP address on the machine. If SOLR_HOST is not working, perhaps the start script in your install has a bug. I was going to look for reported bugs on SOLR_HOST, but the Apache bugtracker (Jira) is down. Thanks, Shawn