Hazelcast client : Connecting to cluster members behind TCP round-robin load-balancer

410 views
Skip to first unread message

dech...@gmail.com

unread,
May 29, 2019, 4:58:34 AM5/29/19
to Hazelcast
Hello,

While looking at Hazelcast Client configuration, I didn't find a proper solution for my problem.

First, let me explain my context & problem.

I set up a cluster of several nodes/members inside a Cloud-Foundry space.
By using internal IPs, each member could see & connect to each other. So far, so good...

I wanted to connect external clients but Cloudfoundry only presents one unique external IP:port for TCP
this external IP:port is mapped to my cluster members through a TCP load-balancer using round-robin for each new connection.
(so for each new connection, it will target to another cluster member)

According to my tests, if I set the unique "external IP:port" in the adresses of my client conf. The client only connects to one cluster member...

Does someone know how I could say to the client : please use this extIP:port for first connection. Get the list of members and open a new connection with the same address until you're connected to another member (at least one).

I took a look to Hazelcast client source code (especially com.hazelcast.client.connection.AddressProvider) but I'm a bit lost.

Any help/idea/clue will be appreciated.
Thanks in advance for having read my full story.

Regards,

Julien


Rafal Leszko

unread,
May 29, 2019, 5:12:48 AM5/29/19
to haze...@googlegroups.com
Hi Julien,

If you have all members exposed via one (load balanced) external IP:port, then you can only use Hazelcast Dummy Client (<smart-routing>false</smart-routing> or clientConfig.setSmartRouting(false) ). Then, you can set this external IP:port as the endpoint and it should work correctly.

Note however that it will have impact on the performance, because the client will always connect to the random (round-robin) member, not necessarily to the right one with the correct data partition.

For Kubernetes, we have a solution in which each Hazelcast member is exposed with a separate external IP:port. Then, you can use Hazelcast Smart Client. You can read about it here: https://github.com/hazelcast/hazelcast-kubernetes#outside-kubernetes-cluster. I don't think there is any solution like that for Cloud-Foundry.

Hope it helps,
Rafał

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/04fdb61b-1ec4-4200-bf09-a65845fa45e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Rafał Leszko
Software Engineer
@RafalLeszko

dech...@gmail.com

unread,
May 29, 2019, 8:47:57 AM5/29/19
to Hazelcast
Hello Rafal,

I'll give a try by disabling smart routing and we'll see how it goes.

Thanks for this quick feedback ;)
To unsubscribe from this group and stop receiving emails from it, send an email to haze...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages