我正在嘗試為模型集創建具有持久性的 Ignite 緩存。也就是說,IgniteCache<String, Set<Model>>。在本地運行時,一切正常。我可以重新啟動應用程序,Ignite 加載它的持久化數據庫。但是當使用 Docker 或 Kubernetes 運行時(帶有用于持久性的掛載卷)我無法重新啟動應用程序。我創建了一個 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) 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));
添加回答
舉報
0/150
提交
取消