【发布时间】:2018-11-06 22:06:31
【问题描述】:
我正在尝试使用 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>
对于集群创建,我使用带有 OrientDB 映像的 StatefulSet 并将所有配置文件挂载为配置映射。我很确定问题不在我的配置文件中,因为使用多播而不是 dns 策略一切正常。另外,Kubernetes集群本身也没有网络问题。
【问题讨论】:
标签: kubernetes orientdb hazelcast