Orientdb: [Update] Add Hazelcast-Kubernetes Support.

Created on 9 Jan 2020  路  6Comments  路  Source: orientechnologies/orientdb

OrientDB Version: 3.0.26

Java Version: https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u232-b09

OS: Debian 10.2

Docker: Docker image 3.0.26

Need to be done

Currently I am always live patching the orientdb image but this is unnecessary.
Could you please update the following libs.

  • Update hazelcast 3.10.6 -> hazelcast 3.11
  • Add hazelcast-kubernetes 1.5.1

The Dockerfile I used and how I have accomplished live patching.

FROM orientdb:3.0.26

# The patch Hazelcast Versions.
ENV KUBERNETES_HAZELCAST_VERSION="1.5.1"
ENV HAZELCAST_VERSION="3.11"
# Hazelcast Version to be patched
ENV ORIENTDB_HAZELCAST_VERSION="3.10.6"
# Default Home for Orientdb
ENV ORIENTDB_HOME="/orientdb"


# Remove current hazelcast and add own hazelcast with kubernetes support
RUN rm ${ORIENTDB_HOME}/lib/hazelcast-${ORIENTDB_HAZELCAST_VERSION}.jar" && \
    wget \
     -nv \
     --directory-prefix="${ORIENTDB_HOME}/lib/" \
     "http://repo1.maven.org/maven2/com/hazelcast/hazelcast-kubernetes/${KUBERNETES_HAZELCAST_VERSION}/hazelcast-kubernetes-${KUBERNETES_HAZELCAST_VERSION}.jar" && \
    wget \
     -nv \
     --directory-prefix="${ORIENTDB_HOME}/lib/" \
     "http://repo1.maven.org/maven2/com/hazelcast/hazelcast/${HAZELCAST_VERSION}/hazelcast-${HAZELCAST_VERSION}.jar"

Expected behavior

This config should work but the discovery module is missing.

<?xml version="1.0" encoding="UTF-8"?>
<- ~ Copyright (c) 2008-2012, Hazel Bilisim Ltd. All Rights Reserved. ~
  ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may
  not use this file except in compliance with the License. ~ You may obtain
  a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~
  ~ Unless required by applicable law or agreed to in writing, software ~ distributed
  under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES
  OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for
  the specific language governing permissions and ~ limitations under the License. -->

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.11.xsd" 
    xmlns="http://www.hazelcast.com/schema/config" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <group>
        <name>name</name>
        <password>password</password>
    </group>
    <properties>
        <property name="hazelcast.discovery.enabled">true</property>
    </properties>
    <network>
        <port auto-increment="false">2434</port>
        <join>
            <multicast enabled="false"/>
            <tcp-ip enabled="false"/>
            <discovery-strategies>
                <discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy">
                    <properties>
                        <property name="namespace">namespace</property>
                        <property name="service-name">service</property>
                        <property name="service-port">2434</property>
                        <property name="ca-certificate"></property>
                    </properties>
                </discovery-strategy>
            </discovery-strategies>
        </join>
    </network>
</hazelcast>

Actual behavior

The provided config is not working for kubernetes hazelcast setup.
It is needed because it makes the cluster more stable than using the current behavior of hard coding cluster members.

Steps to reproduce

Configure a three node cluster setup with the helm chart from here
https://github.com/helm/charts/tree/master/incubator/orientdb
Delete one node and wait. Restart the node. The node is not able to join again.
This is fixed when using hazelcast-kubernetes.

enhancement

All 6 comments

Hi @Cellebyte

I'd say it makes a lot of sense.
Adding hazelcast-kubernetes should not be a big issue, but I have to double-check to make sure that upgrading to v 3.11 does not create any backward compatibility problems

Thanks

Luigi

hi @Cellebyte

Just for completeness, what is the reason to update hazelcast? Are there problems with Kubernetes with 3.10.6?

Thanks

Luigi

It was not mentioned that it is supported. You can try that to. But I needed the 1.5 version because of the ca-cert support. Before version 1.5 you need to add the k8s cert to an embedded jks store which was painfull to add via helm.
https://github.com/hazelcast/hazelcast-kubernetes#requirements-and-recommendations

@luigidellaquila any estimation in which version this gets fixed?

@luigidellaquila will it be introduced in a later version?

Hi,

This will be supported in OrientDB 3.2.0

Regards

@jonsalvas could be interesting for your production installation.

Was this page helpful?
0 / 5 - 0 ratings