Skip to content

Commit

Permalink
SOLR-16150 Provide correct bound zookeeper interface (apache#802)
Browse files Browse the repository at this point in the history
Instead of always giving localhost, we can return the interface that ZK actually listens on.

Co-authored-by: Kevin Risden <[email protected]>
  • Loading branch information
madrob and risdenk authored Oct 18, 2022
1 parent 32e0f68 commit c80cf5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ Build

Other Changes
---------------------
(No changes)
* SOLR-16150: Embedded ZK Server used for zkRun should advertise itself on specific bound interfaces instead of
generically on localhost. (Mike Drob)

================== 9.1.0 ==================

Expand Down
4 changes: 3 additions & 1 deletion solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public String getClientString() {

// if the string wasn't passed as zkHost, then use the standalone server we started
if (zkRun == null) return null;
return "localhost:" + zkProps.getClientPortAddress().getPort();

InetSocketAddress addr = zkProps.getClientPortAddress();
return addr.getHostString() + ":" + addr.getPort();
}

public void parseConfig() {
Expand Down

0 comments on commit c80cf5b

Please sign in to comment.