Skip to content

Commit 7ec46cc

Browse files
Improve docs for public-address configuration [CTT-866] [v/5.5]
Backport of hazelcast#2089 Adds more information around the impact of using/not using public addresses and specifically notes behaviour with clients, CP, and WAN. Fixes https://hazelcast.atlassian.net/browse/CTT-866
1 parent d47394c commit 7ec46cc

File tree

3 files changed

+72
-11
lines changed

3 files changed

+72
-11
lines changed

docs/modules/clients/pages/client-overview.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,5 @@ For help getting started with the Hazelcast clients, see the client tutorials in
9090
For details about using Memcache to communicate directly with a Hazelcast cluster, see xref:memcache.adoc[Memcache].
9191

9292
For information about using the REST API for simple operations, see: xref:rest.adoc[REST].
93+
94+
For networking information, see xref:clusters:network-configuration.adoc[].

docs/modules/clients/pages/java.adoc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,9 +1924,14 @@ See xref:extending-hazelcast:discovery-spi.adoc[Discovery SPI] for more informat
19241924
|Enables the discovery joiner to use public IPs from `DiscoveredNode`.
19251925
See xref:extending-hazelcast:discovery-spi.adoc[Discovery SPI] for more information.
19261926
When set to `true`, the client assumes that it needs to use public IP addresses reported by the members.
1927-
When set to `false`, the client always uses private addresses reported by the members. If it is `null`,
1928-
the client will try to infer how the discovery mechanism should be based on the reachability of the members.
1929-
This inference is not 100% reliable and may result in false-negatives.
1927+
When set to `false`, the client always uses private addresses reported by the members.
1928+
If not set, the client attempts to infer which address type to use by testing member reachability.
1929+
The inference checks only a small sample of members (3 by default) with fixed timeouts, so it is
1930+
not 100% reliable and may produce incorrect results in environments with variable network latency
1931+
or partial connectivity. Additionally, inference is skipped when SSL/TLS is enabled, defaulting to
1932+
private addresses.
1933+
When members are configured with xref:clusters:network-configuration.adoc#public-address[public addresses],
1934+
and you want the clients to use public IP addresses, we recommend explicitly setting this property to `true` rather than relying on inference.
19301935

19311936
|`hazelcast.client.event.queue.capacity`
19321937
|1000000

docs/modules/clusters/pages/network-configuration.adoc

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,26 @@ available configurations that you can perform under the `network` element.
99
[[public-address]]
1010
== Public Address
1111

12-
`public-address` overrides the public address of a member. By default, a member
13-
selects its socket address as its public address. But behind a network address translation (NAT),
14-
two endpoints (members) may not be able to see/access each other.
15-
If both members set their public addresses to their defined addresses on NAT,
16-
then that way they can communicate with each other. In this case, their public addresses
17-
are not an address of a local network interface but a virtual address defined by NAT.
18-
It is optional to set and useful when you have a private cloud.
19-
Note that, the value for this element should be given in the format *`host IP address:port number`*.
12+
`public-address` overrides the address that a member advertises to other members
13+
and clients. By default, a member advertises its socket address.
14+
15+
`public-address` is a Hazelcast configuration value (`host:port`), not a specific
16+
infrastructure object such as a "public IP address". It can be any reachable
17+
address or hostname that other members and clients should use to connect.
18+
19+
Common use cases include:
20+
21+
* **NAT environments**: When members are behind NAT, set the public address to the
22+
externally visible `host:port` so that other members and clients can reach them.
23+
* **Private cloud deployments**: When the member's socket address is not directly
24+
accessible from outside the private network.
25+
26+
The value can be specified as either:
27+
28+
* A public IP address with port: `11.22.33.44:5555`
29+
* A private IP address with port: `10.10.1.25:5701`
30+
* A hostname with port: `member1.example.com:5555`
31+
2032
See the following examples.
2133

2234
[tabs]
@@ -55,6 +67,48 @@ config.getNetworkConfig()
5567
----
5668
====
5769

70+
=== How Public Address Affects Hazelcast Features
71+
72+
The `public-address` setting controls which endpoint a member advertises. Members
73+
still bind and listen on their local bind address, but peers and clients connect
74+
using advertised addresses. Understanding this distinction is important when
75+
configuring your cluster:
76+
77+
[cols="1,3"]
78+
|===
79+
|Feature |Behavior with Public Address
80+
81+
|**Member-to-member communication**
82+
|Members listen on their bind address, but discover and connect to each other
83+
using advertised addresses. If `public-address` is set, other members use that
84+
value.
85+
86+
|**Client connections**
87+
|Clients can use the public address to connect to members. This requires either
88+
explicitly enabling `hazelcast.discovery.public.ip.enabled` on the client, or
89+
relying on automatic inference (see <<client-public-address-discovery>>).
90+
91+
|**WAN Replication**
92+
|Uses defined member addresses. Configure target cluster endpoints explicitly
93+
in WAN replication configuration.
94+
|===
95+
96+
[[client-public-address-discovery]]
97+
=== Client Public Address Discovery
98+
99+
For clients to use members' public addresses, configure the
100+
`hazelcast.discovery.public.ip.enabled` property on the client:
101+
102+
* `true`: The client always uses public addresses reported by members. If the member does not declare
103+
a public address, the client falls back to private IPs as reported by the member list.
104+
* `false`: The client always uses private (internal) addresses reported by members.
105+
* Not set (default): The client attempts to infer which address type to use based on
106+
reachability. See xref:clients:java.adoc#client-system-properties[Client System Properties]
107+
for details on inference behavior and its limitations.
108+
109+
NOTE: We recommend explicitly setting `hazelcast.discovery.public.ip.enabled` to `true`
110+
on clients when members are configured with public addresses, rather than relying on
111+
automatic inference.
58112

59113
[[port]]
60114
== Port

0 commit comments

Comments
 (0)