mirror of https://github.com/apache/lucene.git
SOLR-14999: Option to set the advertised port for Solr. (#2089)
This commit is contained in:
parent
86934787fe
commit
4be49cbdf5
|
@ -338,6 +338,8 @@ Other Changes
|
||||||
|
|
||||||
* SOLR-15057: Avoid unnecessary object retention in FacetRangeProcessor. (Christine Poerschke)
|
* SOLR-15057: Avoid unnecessary object retention in FacetRangeProcessor. (Christine Poerschke)
|
||||||
|
|
||||||
|
* SOLR-14999: New option for specifying the advertised Solr Port (hostPort). Still defaults to "jetty.port". (Houston Putman)
|
||||||
|
|
||||||
================== 8.7.0 ==================
|
================== 8.7.0 ==================
|
||||||
|
|
||||||
Consult the lucene/CHANGES.txt file for additional, low level, changes in this release.
|
Consult the lucene/CHANGES.txt file for additional, low level, changes in this release.
|
||||||
|
|
|
@ -1892,6 +1892,10 @@ if [ -z "$SOLR_PORT" ]; then
|
||||||
SOLR_PORT=8983
|
SOLR_PORT=8983
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$SOLR_PORT_ADVERTISE" ]; then
|
||||||
|
SOLR_OPTS+=("-Dsolr.port.advertise=$SOLR_PORT_ADVERTISE")
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$SOLR_JETTY_HOST" ]; then
|
if [ -n "$SOLR_JETTY_HOST" ]; then
|
||||||
SOLR_OPTS+=("-Dsolr.jetty.host=$SOLR_JETTY_HOST")
|
SOLR_OPTS+=("-Dsolr.jetty.host=$SOLR_JETTY_HOST")
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1088,6 +1088,10 @@ IF "!IS_RESTART!"=="1" set SCRIPT_CMD=start
|
||||||
IF "%SOLR_PORT%"=="" set SOLR_PORT=8983
|
IF "%SOLR_PORT%"=="" set SOLR_PORT=8983
|
||||||
IF "%STOP_PORT%"=="" set /A STOP_PORT=%SOLR_PORT% - 1000
|
IF "%STOP_PORT%"=="" set /A STOP_PORT=%SOLR_PORT% - 1000
|
||||||
|
|
||||||
|
IF DEFINED SOLR_PORT_ADVERTISE (
|
||||||
|
set "SOLR_OPTS=%SOLR_OPTS% -Dsolr.port.advertise=%SOLR_PORT_ADVERTISE%"
|
||||||
|
)
|
||||||
|
|
||||||
IF DEFINED SOLR_JETTY_HOST (
|
IF DEFINED SOLR_JETTY_HOST (
|
||||||
set "SOLR_OPTS=%SOLR_OPTS% -Dsolr.jetty.host=%SOLR_JETTY_HOST%"
|
set "SOLR_OPTS=%SOLR_OPTS% -Dsolr.jetty.host=%SOLR_JETTY_HOST%"
|
||||||
)
|
)
|
||||||
|
|
|
@ -434,8 +434,12 @@ public class SolrXmlConfig {
|
||||||
|
|
||||||
private static CloudConfig fillSolrCloudSection(NamedList<Object> nl, XmlConfigFile config, String defaultZkHost) {
|
private static CloudConfig fillSolrCloudSection(NamedList<Object> nl, XmlConfigFile config, String defaultZkHost) {
|
||||||
|
|
||||||
|
int hostPort = parseInt("hostPort", removeValue(nl, "hostPort"));
|
||||||
|
if (hostPort <= 0) {
|
||||||
|
// Default to the port that jetty is listening on, or 8983 if that is not provided.
|
||||||
|
hostPort = parseInt("jetty.port", System.getProperty("jetty.port", "8983"));
|
||||||
|
}
|
||||||
String hostName = required("solrcloud", "host", removeValue(nl, "host"));
|
String hostName = required("solrcloud", "host", removeValue(nl, "host"));
|
||||||
int hostPort = parseInt("hostPort", required("solrcloud", "hostPort", removeValue(nl, "hostPort")));
|
|
||||||
String hostContext = required("solrcloud", "hostContext", removeValue(nl, "hostContext"));
|
String hostContext = required("solrcloud", "hostContext", removeValue(nl, "hostContext"));
|
||||||
|
|
||||||
CloudConfig.CloudConfigBuilder builder = new CloudConfig.CloudConfigBuilder(hostName, hostPort, hostContext);
|
CloudConfig.CloudConfigBuilder builder = new CloudConfig.CloudConfigBuilder(hostName, hostPort, hostContext);
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<solrcloud>
|
<solrcloud>
|
||||||
|
|
||||||
<str name="host">${host:}</str>
|
<str name="host">${host:}</str>
|
||||||
<int name="hostPort">${jetty.port:8983}</int>
|
<int name="hostPort">${solr.port.advertise:0}</int>
|
||||||
<str name="hostContext">${hostContext:solr}</str>
|
<str name="hostContext">${hostContext:solr}</str>
|
||||||
|
|
||||||
<bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
|
<bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
|
||||||
|
|
|
@ -34,7 +34,7 @@ You can find `solr.xml` in your `$SOLR_HOME` directory (usually `server/solr` or
|
||||||
|
|
||||||
<solrcloud>
|
<solrcloud>
|
||||||
<str name="host">${host:}</str>
|
<str name="host">${host:}</str>
|
||||||
<int name="hostPort">${jetty.port:8983}</int>
|
<int name="hostPort">${solr.port.advertise:0}</int>
|
||||||
<str name="hostContext">${hostContext:solr}</str>
|
<str name="hostContext">${hostContext:solr}</str>
|
||||||
<bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
|
<bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
|
||||||
<int name="zkClientTimeout">${zkClientTimeout:30000}</int>
|
<int name="zkClientTimeout">${zkClientTimeout:30000}</int>
|
||||||
|
@ -134,9 +134,13 @@ The hostname Solr uses to access cores.
|
||||||
The url context path.
|
The url context path.
|
||||||
|
|
||||||
`hostPort`::
|
`hostPort`::
|
||||||
The port Solr uses to access cores.
|
The port Solr uses to access cores, and advertise Solr node locations through liveNodes.
|
||||||
|
This option is only necessary if a Solr instance is listening on a different port than it wants other nodes to contact it at.
|
||||||
|
For example, if the Solr node is running behind a proxy or in a cloud environment that allows for port mapping, such as Kubernetes.
|
||||||
|
`hostPort` is the port that the Solr instance wants other nodes to contact it at.
|
||||||
+
|
+
|
||||||
In the default `solr.xml` file, this is set to `${jetty.port:8983}`, which will use the Solr port defined in Jetty, and otherwise fall back to 8983.
|
In the default `solr.xml` file, this is set to `${solr.port.advertise:0}`.
|
||||||
|
If no port is passed via the `solr.xml` (i.e. `0`), then Solr will default to the port that jetty is listening on, defined by `${jetty.port}`.
|
||||||
|
|
||||||
`leaderVoteWait`::
|
`leaderVoteWait`::
|
||||||
When SolrCloud is starting up, how long each Solr node will wait for all known replicas for that shard to be found before assuming that any nodes that haven't reported are down.
|
When SolrCloud is starting up, how long each Solr node will wait for all known replicas for that shard to be found before assuming that any nodes that haven't reported are down.
|
||||||
|
|
Loading…
Reference in New Issue