1

We have a spring boot application running in physical boxes. Planning to migrate to EKS (AWS). We have hazelcast used for multiple purposes listed below.

Is it possible to use hazelcast itself in AWS to make use of the same features.?
Or should I used any other technology than using hazelcast itself ?

Hazelcast is used for:
1. Master Election (of machines)
2. Caching (To keep some files sometimes and mainly to websocket messages and to transmit those whenever required)

Master Election : It is used to pick any one machine out of 4 boxes, to do a particular job until next restart/re-deploy.

Hazelcast version used : com.hazelcast.hazelcast : 3.4.2

Reference : what algorithm hazelcast uses to find the master node

Note : Previously I mentioned as leader (actually it's master in the case of Hazelcast)

smilyface
  • 5,021
  • 8
  • 41
  • 57
  • You can use (almost) all Hazelcast features regardless on where it's deployed, either physical or AWS or any other cloud environment. You can keep using the same master election and caching features. – mdogan Jan 02 '20 at 07:54
  • 1
    For master election, due to my understanding, you're using the oldest node. If you upgrade to latest 3.12.x, you can use `FencedLock` in `CPSubsystem` for leader election with a strong consistency guarantee. See [FencedLock manual](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#fencedlock) and [Long Live Distributed Locks blog post](https://hazelcast.com/blog/long-live-distributed-locks/) – mdogan Jan 02 '20 at 07:56
  • Thank you @mdogan. We will try that and let you know once done / any doubts. – smilyface Jan 02 '20 at 09:58

2 Answers2

1

For caching, definitely yes. A lot of folks use it that way. Hazelcast is very well integrated with all Kubernetes environments.

For leader election, I'm not sure I understand your use case and what you'd like to do in EKS. In Kubernetes, you usually focus more on the container/pod level, not the machine itself. So, to keep the leader election between pods, then yes, you can use Hazelcast, not problem with that.

Rafał Leszko
  • 4,939
  • 10
  • 19
  • `So, to keep the leader election between pods, then yes` - How can I do that ? Do you have any example or docs. I searched, but didn't find any. We need to connect MSExchange and read mails. At a time, all machines should not read mails (as it may make errors - as already read kind of problems). So we keep one dedicated (leader) machine to read for each restarts / re-deploy. Hope you got the point. – smilyface Dec 10 '19 at 14:47
1

A. You need to upgrade to a more recent version, preferably 3.12.5, as the later versions have more capabilities in terms of features than their predecessors.

B. From what I could understand, you need a distributed lock so that when acquired, no other application or thread or member can perform the operation defined within the lock boundary. Check out here: https://docs.hazelcast.org/docs/3.12.5/manual/html-single/index.html#lock

Using Hazelcast as a distributed system for its features is agnostic to the underlying platform, EKS or AWS direct or on-prem. Once a cluster is formed, you may want to look at Hazelcast as a service with all the distributed features listed in ref manual.

wildnez
  • 1,078
  • 1
  • 6
  • 10