@@ -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+
2032See 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