我正在嘗試為模型集創(chuàng)建具有持久性的 Ignite 緩存。也就是說(shuō),IgniteCache<String, Set<Model>>。在本地運(yùn)行時(shí),一切正常。我可以重新啟動(dòng)應(yīng)用程序,Ignite 加載它的持久化數(shù)據(jù)庫(kù)。但是當(dāng)使用 Docker 或 Kubernetes 運(yùn)行時(shí)(帶有用于持久性的掛載卷)我無(wú)法重新啟動(dòng)應(yīng)用程序。我創(chuàng)建了一個(gè) GitHub 存儲(chǔ)庫(kù)以便于測(cè)試... https://github.com/jesjobom/ignite-persistence-test/主要配置:System.setProperty(IgniteSystemProperties.IGNITE_NO_SHUTDOWN_HOOK, "true");IgniteConfiguration igniteConfiguration = new IgniteConfiguration();//Region for persistent (in disk) dataDataRegionConfiguration 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 configdataStorageConfiguration.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));
1 回答

手掌心
TA貢獻(xiàn)1942條經(jīng)驗(yàn) 獲得超3個(gè)贊
看起來(lái) IGNITE_HOME 目錄指的是在重新啟動(dòng)時(shí)被清除的卷/文件夾。請(qǐng)將該變量設(shè)置為一個(gè)路徑,該路徑不會(huì)像您對(duì)存儲(chǔ)和 WAL 所做的那樣重新啟動(dòng)。
添加回答
舉報(bào)
0/150
提交
取消