kandi X-RAY | hazelcast-kubernetes Summary
kandi X-RAY | hazelcast-kubernetes Summary
This repository contains a plugin which provides the automatic Hazelcast member discovery in the Kubernetes environment. You can use it in your project deployed on Kubernetes in order to make the embedded Hazelcast members discover each other automatically. This plugin is also included in Hazelcast Docker images, Hazelcast Helm Charts, and Hazelcast OpenShift Docker image.
Top functions reviewed by kandi - BETA
- Resolves the local endpoints
- Extracts nodes from a list of endpoints
- Make a request
- Adds public IPs to the list of public IPs
- Resolves the service
- Lookup a list of nodes
- Validates the configuration
- Retrieves the namespace from the system properties or fallback if not set
hazelcast-kubernetes Key Features
hazelcast-kubernetes Examples and Code Snippets
Trending Discussions on hazelcast-kubernetes
I am using Hazelcast Scheduled Executor Service in order to run a specific task, on one service instance only. In order to achieve this behavior we take advantage of com.hazelcast.scheduledexecutor.TaskUtils.named(java.lang.String, java.lang.Runnable) decorator to avoid duplicate tasks.
Hazelcast dependencies used:...
ANSWERAnswered 2021-Aug-26 at 10:30
This is not directly possible, but there is an approximation.
IScheduledExecutorService does not provide a method to provide an ordering for which members to use.
- You can submit a task to a specific member, but this won't failover to a member of your choosing if the original specific member dies.
- ... various other options ...
- Or the option in your code,
scheduleAtFixedRatewhich will pick a member, and this may be a different member each time the cluster changes size. It should not always be the newest unless by co-incidence.
What you could do is have a scheduled task that selects a member to run an ordinary task upon. One task that launches another.
In the scheduled task, the
run() could call
hazelcastInstance.getCluster().getMembers() to get the list of members in the cluster. All it needs is some logic to pick a member, and then do
You might pick a member with a specific attribute that you configure. Or a member with a specific IP. Perhaps simplest is to pick the oldest, since this doesn't change until the oldest leaves, in which case 2nd olest is now oldest, easy failover.
I have a spring boot 2.5 application with spring spring security 5 where I am using embedded hazelcast cache to back spring sessions. This application is deployed on openshift with two pods where same application is running, hence I have used hazelcast kubernetes plugin for service discovery. Everything is working as expected. However, I can see application logs are flooded with below log lines. Any suggestion what is wrong with the hazelcast configuration ? Why so many log lines are generated ?
10.1.8.58 is IP address of second pod which joined cluster later and logs are printed in this pod only....
ANSWERAnswered 2021-Jun-07 at 07:29
The exception you get
SplitBrainMergeValidationOp means that the Hazelcast cluster might have been started in the split-brain and later tries to merge into one cluster. Could you check if you follow all the Hazelcast Kubernetes recommendations?
Especially, check if you use StatefulSet (not Deployment). In the case of DNS Lookup discovery, using Deployment may cause Hazelcast to start in the split-brain mode.
I want to configure vertx at k8s by using hazelcast-kubernetes in Quarkus.
I need configure event-bus like this:...
ANSWERAnswered 2021-Mar-29 at 08:15
I don't believe you can configure
VertxOptions from code.
You could put a
cluster.xml Hazelcast configuration file in the classpath instead.
Note that the Vert.x cluster managers are not supported in Quarkus yet. You can make them work in JVM mode (see this attempt with Infinispan) but not in native mode.
I am using Mongck to migrate data in my Spring Boot application. Spring Boot application runs perfectly locally. But when running on docker, the following error occurs:...
ANSWERAnswered 2021-Mar-14 at 22:30
As discussed in this Github issue, the issue was resolved by upgrading to version 4.3.7.
I was using Zookeeper Hazelcast discovery but now i have changed it to Hazelcast-Kubernetes. It seems it is working fine but some times it prints warning message like :...
ANSWERAnswered 2020-Oct-19 at 09:08
There is a similar issue report in this GH Issue. As described there, adding the following part might solve the issue:
I'm trying to start a simple embedded hazelcast server in a spring boot application on kubernetes. I'm using hazelcast-kubernetes plugin and have followed the documentation here. I tried both LoadBalancer and NodePort service types.
I also tried to deploy the sample application using this example (using the same docker image) and tried both LoadBalancer and NodePort service types.
In both cases I get the below error after 10 retries to connect to Kubernetes Master. Where a.b.c.d is the IP address of the kubernetes master node....
ANSWERAnswered 2020-Mar-12 at 07:43
You seem to have an issue with your Kubernetes cluster itself.
First you try to use Hazelcast Kubernetes Discovery strategy Kubernetes API, which makes a REST call to Kubernetes master. Kubernetes master should be always accessible from your POD by the hostname
kubernetes.default.svc. In your case, it's not found.
Then, you try to use Hazelcast Kubernetes Discovery strategy DNS Lookup, which uses service DNS to resolve Hazelcast members. In your case, as mentioned by @Mesut, it's not resolving correctly the DNS of a service.
No vulnerabilities reported
terminationGracePeriodSeconds: in your StatefulSet (or Deployment) configuration; the value should be high enough to cover the data migration process
-Dhazelcast.shutdownhook.policy=GRACEFUL: in the JVM parameters
-Dhazelcast.graceful.shutdown.max.wait: in the JVM parameters; the value should be high enough to cover the data migration process
If you use Deployment (not StatefulSet), you need to set your strategy to RollingUpdate and ensure Pods are updated one by one.
If you upgrade by the minor version, e.g., 3.11.4 => 3.12 (Enterprise feature), you need to set the following JVM property -Dhazelcast.cluster.version.auto.upgrade.enabled=true to make sure the cluster version updates automatically.
Reuse Trending Solutions
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page