未定义Hazelcast Kubernetes插件

时间:2018-11-04 10:03:05

标签: kubernetes orientdb hazelcast

我正在尝试使用Kubernetes创建一个OrientDB(3.0.10版)集群。 OrientDB在其分布式模式下使用Hazelcast(版本3.10.4),这就是为什么我讨厌设置KubernetesHazelcast插件。我以this repository为例。  我已经创建了所有必需的配置文件,在我的项目的build.sbt文件中定义了hazelcast Kubernetes依赖项(版本1.3.1),并且此依赖项出现在类路径中 但是,每个Pod上的日志显示以下错误消息:

com.orientechnologies.orient.server.distributed.ODistributedStartupException: Error on starting distributed plugin
Caused by: com.hazelcast.config.properties.ValidationException: There is no discovery strategy factory to create 'DiscoveryStrategyConfig{properties={service-dns=orientdbservice2.default.svc.cluster.local, service-dns-timeout=10}, className='com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy', discoveryStrategyFactory=null}' Is it a typo in a strategy classname? Perhaps you forgot to include implementation on a classpath?

因此,看起来Hazelcast Kubernetes依赖项是以一种破旧的方式设置的。该错误如何解决?

这是我的配置hazelcast.xml文件:

   <properties>
        <property name="hazelcast.discovery.enabled">true</property>
    </properties>
    <network>
        <join>
            <multicast enabled="false"/>
            <tcp-ip enabled="false" />
            <discovery-strategies>
                <discovery-strategy enabled="true"
                                    class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy">

                    <properties>
                        <property name="service-dns">orientdbservice2.default.svc.cluster.local</property>
                        <property name="service-dns-timeout">10</property>
                    </properties>
                </discovery-strategy>
            </discovery-strategies>
        </join>
    </network>

对于集群创建,我将StatefulSet与OrientDB映像一起使用,并将所有配置文件挂载为配置映射。我很确定问题不在我的配置文件中,而是使用多播而不是dns策略,一切正常。另外,Kubernetes集群本身也没有网络问题。

1 个答案:

答案 0 :(得分:1)

首先,应将OrientDB版本更新至最新版本-具有嵌入式最新Hazelcast版本的3.0.10。另外,我已经将hazelcast-kubernetes.jar依赖文件直接安装到/ orientdb / lib文件夹中,并且开始正常工作。已发现HazelcastKubernetes插件,并且节点加入了集群:

INFO  [172.17.0.3]:5701 [orientdb-test-cluster-1] [3.10.4] Kubernetes Discovery activated resolver: DnsEndpointResolver [DiscoveryService]
INFO  [172.17.0.3]:5701 [orientdb-test-cluster-1] [3.10.4] Activating Discovery SPI Joiner [Node]
INFO  [172.17.0.3]:5701 [orientdb-test-cluster-1] [3.10.4] Starting 2 partition threads and 3 generic threads (1 dedicated for priority tasks) [OperationExecutorImpl]

Members {size:3, ver:3} [
    Member [172.17.0.3]:5701 - hash
    Member [172.17.0.4]:5701 - hash
    Member [172.17.0.8]:5701 - hash
]