You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Brian Wright <br...@marketo.com> on 2016/03/12 06:21:23 UTC
SOLR_HOME vs solr.xml (solrcloud config)
Hi,
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.
|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.
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?
Thanks.
--
Signature
*Brian Wright*
*Sr. Systems Engineer *
901 Mariners Island Blvd Suite 200
San Mateo, CA 94404 USA
*Email *brianw@marketo.com <ma...@marketo.com>
*Phone *+1.650.539.3530**
*****www.marketo.com <http://www.marketo.com/>*
Marketo Logo
Re: SOLR_HOST vs solr.xml (solrcloud config)
Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/12/2016 10:47 AM, Shawn Heisey wrote:
> 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
Jira's back. If you're running a version before 5.2, there is indeed a
bug in the start script with SOLR_HOST.
https://issues.apache.org/jira/browse/SOLR-7545
Thanks,
Shawn
Re: SOLR_HOST vs solr.xml (solrcloud config)
Posted by Shawn Heisey <ap...@elyograg.org>.
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
Re: SOLR_HOST vs solr.xml (solrcloud config)
Posted by Brian Wright <br...@marketo.com>.
Correction...
Too fast on the send button. The subject should have been SOLR_HOST, not
SOLR_HOME. Sorry for any confusion. Though, the body is correct.
On 3/11/16 9:21 PM, Brian Wright wrote:
> Hi,
>
> 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.
>
> |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.
>
> 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?
>
> Thanks.
>
> --
> Signature
>
> *Brian Wright*
> *Sr. Systems Engineer *
> 901 Mariners Island Blvd Suite 200
> San Mateo, CA 94404 USA
> *Email *<ma...@marketo.com>brianw@marketo.com
> *Phone *+1.650.539.3530**
> *****<http://www.marketo.com/>www.marketo.com*
>
> Marketo Logo
>
>
--
Signature
*Brian Wright*
*Sr. Systems Engineer *
901 Mariners Island Blvd Suite 200
San Mateo, CA 94404 USA
*Email *brianw@marketo.com <ma...@marketo.com>
*Phone *+1.650.539.3530**
*****www.marketo.com <http://www.marketo.com/>*
Marketo Logo