0
votes

I'm using a couple of Hazelcast clusters for separate purposes and don't want them to interact so have used different cluster groups. I've written a simple monitor application to keep track of the members of each cluster, but wondered if there's a way of determining which cluster groups are reachable? The monitor connects as a client and I've had to hard code cluster group names in my application configuration so it can attempt to create a connection with each. That's fine for the moment with only two groups but as my usage expands it would be helpful if I could programmatically determine all the clusters available for connection - is this possible?

Thanks

3

3 Answers

0
votes

Group names are the credentials for the Clusters. Unless you know the name, you won't be able to connect to it.
We have a similar use-case and are handling this by maintaining a property of list of group names and just looping through them to check the connections. This requires you to either have a common group password or retrieve the corresponding passwords from other source.

0
votes

A possible solution: Instantiate two clients with different configs, one is configured for cluster1 and the other for cluster2. Attach, client lifecycle listener to each client. Look for CLIENT_DISCONNECTED and CLIENT_CONNECTED events.

0
votes