Here is some additional Information.
(1) The code that builds the protocol stack ...
private Protocol[] getProtocolStack() {
log.info("Using cluster protocol '" + this.protocol + "'.");
List<String> membersList;
if ("".equals(members) || members == null) {
membersList = List.of(nodeId);
} else {
membersList = List.of(members.split(","));
}
log.info("Using cluster members '" + membersList + "'.");
TP tp;
Protocol ping;
if (protocol.equals("tcp")) {
log.info("Using port '" + this.port + "'.");
log.info("Using port range '" + portRange + "'.");
log.info("Using bootstrap server '" + bootstrapServers + "'.");
List<IpAddress> initialHosts = getInitialHosts(bootstrapServers);
for (IpAddress ipAddress : initialHosts) {
log.info("Contacting node using address '" + ipAddress.printIpAddress() + "'.");
}
tp = new TCP();
tp.setBindPort(port);
ping = new TCPPING()
.setValue("initial_hosts", initialHosts)
.setValue("port_range", portRange);
} else {
tp = new UDP();
ping = new PING();
}
if (!"".equals(externalAddress)) {
log.info("Using external address '" + externalAddress + "'.");
try {
tp.setExternalAddr(InetAddress.getByName(externalAddress));
} catch (UnknownHostException e) {
log.error("External address '" + externalAddress + "' was not found.");
}
}
RAFT raft = new RAFT() // Raft protocol
.members(membersList)
.setValue("raft_id", nodeId)
.setValue("log_dir", uvuyoHome + File.separator + "data")
.setValue("log_prefix", "memdb." + nodeId)
.setValue("max_log_size", maxLogSize)
.setValue("log_class", "org.jgroups.protocols.raft.FileBasedLog");
return new Protocol[]{
tp,
ping, // Discovery protocol
new MERGE3(), // Handles cluster splits
new FD_SOCK(), // Failure detection based on nodes connecting to neighbors
new FD_ALL() // Failure detection based on heartbeats
.setValue("timeout_check_interval", failureDetectionTimeout),
new VERIFY_SUSPECT(), // After detecting Failure check if node is really gone
new NAKACK2(), // Reliable FIFO message transfer
new UNICAST3(), // Reliable FIFO message transfer
new STABLE(), // Garbage Collect message
new GMS(), // Handle Group Membership
new UFC(), // Unicast Flow Control
new MFC(), // Multicast Flow Control
new FRAG2(), // Fragment large messages
new BARRIER(), // Needed by state transfer
new STATE_TRANSFER(), // Allow states to be transferred between nodes
new ELECTION(),
raft,
new REDIRECT(),
new CLIENT()
};
}
And here is the log output to show the values ...
2025-04-24T11:42:39.350+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Using cluster protocol 'tcp'.
2025-04-24T11:42:39.350+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Using cluster members '[uvuyo1, uvuyo2, uvuyo3]'.
2025-04-24T11:42:39.350+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Using port '7800'.
2025-04-24T11:42:39.350+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Using port range '0'.
2025-04-24T11:42:39.350+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Using bootstrap server 'bmchlx-stg-tool1:7800,bmchlx-stg-tool2:7800,bmchlx-stg-tool3:7800'.
2025-04-24T11:42:39.358+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Contacting node using address '
10.144.19.190:7800'.
2025-04-24T11:42:39.358+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Contacting node using address '
10.144.24.85:7800'.
2025-04-24T11:42:39.358+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Contacting node using address '
10.144.21.127:7800'.
2025-04-24T11:42:39.584+02:00 INFO 1070980 --- [ main] n.t.uvuyo.cluster.ClusterManager : Joining RAFT cluster 'uvuyo-gateway-2yetis' ...
2025-04-24T11:42:39.587+02:00 INFO 1070980 --- [ main] org.jgroups.JChannel : local_addr: uvuyo2, name: bmchlx-stg-tool2-42215