Skip to content

Commit

Permalink
[CN-1206]: Add Notes to HA Documentation about Multi Member Routing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kutluhan Metin authored Jul 25, 2024
1 parent f46c330 commit eccf8d0
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
highAvailabilityMode: ZONE
exposeExternally:
type: Smart
discoveryServiceType: LoadBalancer
memberAccess: LoadBalancer
57 changes: 55 additions & 2 deletions docs/modules/ROOT/pages/high-availability-mode.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When using either type of partition grouping (ZONE_AWARE or NODE_AWARE) with a H
The `highAvailabilityMode` parameter allows you to specify partition groups and to automatically distribute members across availability zones and nodes, using the Kubernetes policy `topologySpreadConstraints`.


== Configuring High Availability Mode
== Configuring High Availability Mode

Below are the configuration options for the High Availability Mode feature.

Expand Down Expand Up @@ -57,4 +57,57 @@ Below are the configuration options for the High Availability Mode feature.
[source,yaml,subs="attributes+"]
----
include::ROOT:example$/hazelcast-high-availability-mode.yaml[]
----
----

== High Availability Mode and MULTI_MEMBER Routing

`MULTI_MEMBER` routing is a client feature that allows a client to connect to a subset of members that is determined by a grouping strategy. To benefit from `MULTI_MEMBER` routing, you must enable high availability mode, because this parameter is used to determine partition groups. Also, if the `MULTI_MEMBER` routing mode is used on the client-side, `exposeExternally.type` must be set to `smart` in the Hazelcast CR.

Example server and client configurations to use `MULTI_MEMBER` routing:

[source,yaml,subs="attributes+"]
----
include::ROOT:example$/hazelcast-high-availability-mode-multi-member-routing.yaml[]
----

[tabs]
====
Java::
+
--
[source, java]
----
ClientConfig clientConfig = new ClientConfig();
ClientNetworkConfig networkConfig = clientConfig.getNetworkConfig();
networkConfig.getClusterRoutingConfig().setRoutingMode(RoutingMode.MULTI_MEMBER);
// PARTITION_GROUPS is the default strategy, so it does not need to be explicitly defined
networkConfig.getClusterRoutingConfig().setRoutingStrategy(RoutingStrategy.PARTITION_GROUPS);
----
--
XML::
+
--
[source, xml]
----
...
<network>
<cluster-routing mode="MULTI_MEMBER">
<grouping-strategy>PARTITION_GROUPS</grouping-strategy>
</cluster-routing>
</network>
...
----
--
YAML::
+
--
[source, yaml]
----
network:
cluster-routing:
mode: MULTI_MEMBER
grouping-strategy: PARTITION_GROUPS
----
--

0 comments on commit eccf8d0

Please sign in to comment.