Skip to content

Conversation

@epugh
Copy link
Contributor

@epugh epugh commented Oct 27, 2025

https://issues.apache.org/jira/browse/SOLR-15442

solr.jetty.host ..> solr.host.bind and SOLR_HOST/host --> solr.host.advertise

solr.jetty.host ..> solr.host.bind and SOLR_HOST/host --> solr.host.advertise
@epugh epugh requested review from dsmiley and janhoy October 27, 2025 01:18

if [ -n "${SOLR_JETTY_HOST:-}" ]; then
SCRIPT_SOLR_OPTS+=("-Dsolr.jetty.host=$SOLR_JETTY_HOST")
if [ -n "${SOLR_HOST_BIND:-}" ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we look up solr.host.bind in java code with our envutils, then maybe we don't need to these lines, because the environment variable gets mapped to system property for us...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this isn't true because the variable is used in the jetty config files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right.... Jetty doesn't use our EnvUtils... And I guess chicken/egg.. We can't intercept it and set it...

@epugh
Copy link
Contributor Author

epugh commented Oct 27, 2025

I don't think i can do solr.port.listen until we dig deeper?

@epugh
Copy link
Contributor Author

epugh commented Oct 27, 2025

I took a stab at migrating to solr.port.listen and we'll see how the tests go. I had to keep a jetty.port, but I'm only using it to tickle Jetty to do the right thing, everywhere else it's solr.port.listen.

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good; thanks.

@@ -0,0 +1,10 @@
# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
title: Sync up port and host variable naming.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users won't know what to think of that

@dsmiley dsmiley requested a review from HoustonPutman October 29, 2025 03:58
@epugh epugh requested a review from Copilot October 29, 2025 15:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors Solr's port and host configuration properties to establish a clearer and more consistent naming convention. The changes introduce new property names that better distinguish between "bind" (the interface Solr listens on) and "advertise" (the interface Solr announces to clients/ZooKeeper), while maintaining backward compatibility through deprecation mappings.

  • Renames SOLR_PORT/jetty.port to SOLR_PORT_LISTEN/solr.port.listen
  • Renames SOLR_JETTY_HOST/solr.jetty.host to SOLR_HOST_BIND/solr.host.bind
  • Renames SOLR_HOST/host to SOLR_HOST_ADVERTISE/solr.host.advertise
  • Updates all configuration files, scripts, documentation, and tests to use the new property names

Reviewed Changes

Copilot reviewed 19 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
solr/solrj/src/resources/EnvToSyspropMappings.properties Updates environment variable to system property mapping for new SOLR_PORT_LISTEN
solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties Adds deprecation mappings for old property names to new ones
solr/solrj/src/test/org/apache/solr/common/util/EnvUtilsTest.java Updates test to use new SOLR_PORT_LISTEN variable
solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc Documents the deprecations and new property names
solr/solr-ref-guide/modules/getting-started/pages/tutorial-aws.adoc Updates documentation example to use SOLR_HOST_BIND
solr/solr-ref-guide/modules/deployment-guide/pages/securing-solr.adoc Updates security documentation with new property names
solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc Adds documentation for new host and port properties
solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc Updates example to use solr.host.advertise
solr/server/solr/solr.xml Updates default config to use solr.host.advertise
solr/server/etc/jetty-https.xml Updates Jetty config to use solr.host.bind
solr/server/etc/jetty-http.xml Updates Jetty config to use solr.host.bind
solr/modules/cross-dc/src/test-files/mirroring-solr.xml Updates test config to use new advertise properties
solr/docker/templates/Dockerfile.body.template Updates Docker default to use SOLR_HOST_BIND
solr/core/src/java/org/apache/solr/servlet/CoreContainerProvider.java Updates code to use EnvUtils.getProperty for solr.port.listen
solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java Updates to use EnvUtils for solr.port.listen
solr/core/src/java/org/apache/solr/cli/SolrProcessManager.java Updates process detection to check for both old and new port property
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java Updates to use SOLR_PORT_LISTEN environment variable
solr/core/src/java/org/apache/solr/cli/CLIUtils.java Updates to use solr.port.listen property
solr/bin/solr.in.sh Updates default environment variable names in comments and examples
solr/bin/solr.in.cmd Updates default environment variable names in comments and examples
solr/bin/solr.cmd Implements SOLR_PORT_LISTEN and SOLR_HOST_BIND with backward compatibility for deprecated variables
solr/bin/solr Implements SOLR_PORT_LISTEN and SOLR_HOST_BIND with backward compatibility for deprecated variables
changelog/unreleased/SOLR-15442.yml Adds changelog entry for the property sync

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@epugh epugh changed the title SOLR-15442: Sync up port and host variable naming SOLR-15442: Sync up Solr (Jetty) port and host variable naming Oct 31, 2025
Co-authored-by: David Smiley <dsmiley@apache.org>
@epugh epugh changed the title SOLR-15442: Sync up Solr (Jetty) port and host variable naming SOLR-15442: Sync up Solr (Jetty) host and ports variable naming Nov 3, 2025
@epugh
Copy link
Contributor Author

epugh commented Nov 3, 2025

I need to manually test solr/bin/install_solr_service.sh and then will merge this to main and branch_10 and branch_10_x.

@epugh
Copy link
Contributor Author

epugh commented Nov 3, 2025

I need to manually test solr/bin/install_solr_service.sh and then will merge this to main and branch_10 and branch_10_x.

Tested on a fresh box and it works!!!!!!!!! Tweaked ref guide cause that one property catches me ALL the time, and maybe I help the next person.

@HoustonPutman
Copy link
Contributor

Thanks for getting this done!

@epugh epugh merged commit 7f635a9 into apache:main Nov 4, 2025
7 checks passed
@epugh
Copy link
Contributor Author

epugh commented Nov 4, 2025

will let jenkins tests run and then back port...

epugh added a commit that referenced this pull request Nov 4, 2025
Sync up port and host variable naming:

* solr.jetty.host --> solr.host.bind
* SOLR_HOST/host --> solr.host.advertise
* jetty.port --> solr.port.listen and SOLR_PORT_LISTEN

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: David Smiley <dsmiley@apache.org>
epugh added a commit that referenced this pull request Nov 4, 2025
Sync up port and host variable naming:

* solr.jetty.host --> solr.host.bind
* SOLR_HOST/host --> solr.host.advertise
* jetty.port --> solr.port.listen and SOLR_PORT_LISTEN

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: David Smiley <dsmiley@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants