gpt4 book ai didi

java - Ignite 持久化 Set : Cannot find metadata for object with compact footer

转载 作者:行者123 更新时间:2023-11-30 10:01:16 24 4
gpt4 key购买 nike

我正在尝试为模型集创建具有持久性的 Ignite 缓存。即 IgniteCache<String, Set<Model>> .

在本地运行时,一切正常。我可以重新启动应用程序,Ignite 加载它的持久化数据库。

但是当使用 Docker 或 Kubernetes 运行时(带有挂载卷以实现持久性)我无法重新启动应用程序。否则我会收到此错误:

Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Cannot find metadata for object with compact footer: 2097659979
at org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1337)
at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.cacheException(IgniteCacheProxyImpl.java:1758)
at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.get(IgniteCacheProxyImpl.java:931)
at org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.get(GatewayProtectedCacheProxy.java:640)
at com.jesjobom.IgnitePersistence.remove(IgnitePersistence.java:81)
at com.jesjobom.IgnitePersistence.add(IgnitePersistence.java:66)
at com.jesjobom.Main.main(Main.java:17)
Caused by: class org.apache.ignite.IgniteCheckedException: Cannot find metadata for object with compact footer: 2097659979
at org.apache.ignite.internal.util.IgniteUtils.cast(IgniteUtils.java:7429)
at org.apache.ignite.internal.util.future.GridFutureAdapter.resolve(GridFutureAdapter.java:261)
at org.apache.ignite.internal.util.future.GridFutureAdapter.get0(GridFutureAdapter.java:172)
at org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:141)
at org.apache.ignite.internal.processors.cache.GridCacheAdapter.get0(GridCacheAdapter.java:4723)
at org.apache.ignite.internal.processors.cache.GridCacheAdapter.get(GridCacheAdapter.java:4697)
at org.apache.ignite.internal.processors.cache.GridCacheAdapter.get(GridCacheAdapter.java:1415)
at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.get(IgniteCacheProxyImpl.java:928)
... 4 more
Caused by: class org.apache.ignite.binary.BinaryObjectException: Cannot find metadata for object with compact footer: 2097659979
at org.apache.ignite.internal.binary.BinaryReaderExImpl.getOrCreateSchema(BinaryReaderExImpl.java:2012)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.<init>(BinaryReaderExImpl.java:286)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.<init>(BinaryReaderExImpl.java:185)
at org.apache.ignite.internal.binary.BinaryObjectImpl.reader(BinaryObjectImpl.java:832)
at org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:795)
at org.apache.ignite.internal.binary.BinaryObjectImpl.value(BinaryObjectImpl.java:143)
at org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinary(CacheObjectUtils.java:177)
at org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapKnownCollection(CacheObjectUtils.java:93)
at org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinary(CacheObjectUtils.java:181)
at org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinaryIfNeeded(CacheObjectUtils.java:67)
at org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinaryIfNeeded(CacheObjectContext.java:125)
at org.apache.ignite.internal.processors.cache.GridCacheContext.unwrapBinaryIfNeeded(GridCacheContext.java:1773)
at org.apache.ignite.internal.processors.cache.GridCacheContext.unwrapBinaryIfNeeded(GridCacheContext.java:1761)
at org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedSingleGetFuture.setResult(GridPartitionedSingleGetFuture.java:695)
at org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedSingleGetFuture.localGet(GridPartitionedSingleGetFuture.java:477)
at org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedSingleGetFuture.mapKeyToNode(GridPartitionedSingleGetFuture.java:354)
at org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedSingleGetFuture.map(GridPartitionedSingleGetFuture.java:225)
at org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedSingleGetFuture.init(GridPartitionedSingleGetFuture.java:217)
at org.apache.ignite.internal.processors.cache.distributed.dht.colocated.GridDhtColocatedCache.getAsync(GridDhtColocatedCache.java:272)
at org.apache.ignite.internal.processors.cache.GridCacheAdapter.get0(GridCacheAdapter.java:4716)
... 7 more
^C

我创建了一个 GitHub 存储库以便于测试... https://github.com/jesjobom/ignite-persistence-test/

主要配置:

System.setProperty(IgniteSystemProperties.IGNITE_NO_SHUTDOWN_HOOK, "true");

IgniteConfiguration igniteConfiguration = new IgniteConfiguration();

//Region for persistent (in disk) data
DataRegionConfiguration persistence = new DataRegionConfiguration().setPersistenceEnabled(true)
.setInitialSize(64 * 1024 * 1024)
.setMaxSize(128 * 1024 * 1024).setName(PERSISTENT_REGION_NAME);

DataStorageConfiguration dataStorageConfiguration = new DataStorageConfiguration().setDefaultDataRegionConfiguration(persistence);

//Persistence location config
dataStorageConfiguration.setWalPath(STORAGE_LOCATION + "/wal")
.setWalArchivePath(STORAGE_LOCATION + "/wal-arc")
.setStoragePath(STORAGE_LOCATION + "/store");

igniteConfiguration.setDataStorageConfiguration(dataStorageConfiguration);

ignite = Ignition.getOrStart(igniteConfiguration);
ignite.cluster().active(true);

store = ignite.getOrCreateCache(new CacheConfiguration<String, Set<Model>>()
.setDataRegionName(PERSISTENT_REGION_NAME)
.setCacheMode(CacheMode.REPLICATED)
.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
.setName("store")
.setIndexedTypes(String.class, Set.class)
);

最佳答案

看起来 IGNITE_HOME 目录指的是在重新启动时被清除的卷/文件夹。请将该变量设置为一个路径,该路径不会像您对存储和 WAL 所做的那样重新启动。

关于java - Ignite 持久化 Set : Cannot find metadata for object with compact footer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57529702/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com