我用Ignite Helm chart stable/ignite version 2.7.6
在Kubernetes上设置了我的Ignite集群。
但是很快我会收到类似的错误:
JVM will be halted immediately due to the fail ure: [failureCtx=FailureContext [type=SYSTEM_WORKER_TERMINATION, err=java.lang.IllegalStateExce ption: Topology is not initialized: app-profiles]]
结果,Ignite Kubernetes容器一次又一次地重新启动。
相关的缓存app-profiles
的配置如下:
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="app-profiles" />
<property name="cacheMode" value="LOCAL" />
<property name="onheapCacheEnabled" value="true" />
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="10000" />
</bean>
</property>
<property name="expiryPolicyFactory">
<bean id="expiryPolicy" class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf">
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="SECONDS" />
<constructor-arg value="43200" />
</bean>
</constructor-arg>
</bean>
</property>
</bean>
发现问题出在cacheMode LOCAL。以某种方式,LOCAL
模式下的缓存无法初始化其拓扑(Ignite版本2.7.6)。只需将其替换为PARTITIONED
cacheMode,问题就消失了,如下所示:
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="app-profiles" />
<!-- <property name="cacheMode" value="LOCAL" /> -->
<property name="cacheMode" value="PARTITIONED" />
<property name="onheapCacheEnabled" value="true" />
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="10000" />
</bean>
</property>
<property name="expiryPolicyFactory">
<bean id="expiryPolicy" class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf">
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="SECONDS" />
<constructor-arg value="43200" />
</bean>
</constructor-arg>
</bean>
</property>
</bean>
并且cacheMode REPLICATED
也应该起作用。