2017-08-04 79 views
2

嘗試在Apache Ignite v2.1中使用新的Ignite Persistent Store時出現錯誤。我創建了一個新的空白.Net控制檯應用程序,並添加了Apache Ignite v2.1 nuget包。Apache Ignite 2.1:設置PersistentStoreConfiguration屬性時出錯

當調用ignite.SetActive(true)時引發以下兩個異常;

我嘗試了一堆不同的選擇,但是這似乎是我能夠最大限度地發揮它的作用。它將數據寫入Work文件夾,但它永遠不會超過SetActive方法。如果我在設置PersistentStoreConfiguration屬性時註釋掉該行,則它會繼續正常工作。

錯誤1:

無法重新初始化本地分區(預加載將被停止): GridDhtPartitionExchangeId [topVer = AffinityTopologyVersion [topVer = 1, minorTopVer = 1],NODEID = 07fd3596,EVT = DISCOVERY_CUSTOM_EVT]

錯誤2:

無法等待分區映射交換完成(預壓 不會啓動):GridDhtPartitionsExchangeFuture

登錄:

[18:00:04] Ignite node started OK (id=07fd3596) 
[18:00:04] Topology snapshot [ver=1, servers=1, clients=0, CPUs=4, heap=3.5GB] 
[18:00:04] Default checkpoint page buffer size is too small, setting to an adjus 
ted value: 2.0 GiB 
Aug 04, 2017 6:00:05 PM org.apache.ignite.logger.java.JavaLogger error 
SEVERE: Failed to reinitialize local partitions (preloading will be stopped): Gr 
idDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=1, minorTopVer= 
1], nodeId=07fd3596, evt=DISCOVERY_CUSTOM_EVT] 
java.lang.NullPointerException 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.applyUpdate(GridCacheDatabaseSharedManager.java:1620) 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.applyLastUpdates(GridCacheDatabaseSharedManager.java:1492) 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.restoreState(GridCacheDatabaseSharedManager.java:929) 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.beforeExchange(GridCacheDatabaseSharedManager.java:733) 
     at org.apache.ignite.internal.processors.cache.distributed.dht.preloader 
.GridDhtPartitionsExchangeFuture.distributedExchange(GridDhtPartitionsExchangeFu 
ture.java:994) 
     at org.apache.ignite.internal.processors.cache.distributed.dht.preloader 
.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:632) 
     at org.apache.ignite.internal.processors.cache.GridCachePartitionExchang 
eManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1901) 
     at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java 
:110) 
     at java.lang.Thread.run(Thread.java:748) 

Aug 04, 2017 6:00:05 PM org.apache.ignite.logger.java.JavaLogger error 
SEVERE: Failed to wait for completion of partition map exchange (preloading will 
not start): GridDhtPartitionsExchangeFuture [dummy=false, forcePreload=false, r 
eassign=false, discoEvt=DiscoveryCustomEvent [customMsg=null, affTopVer=Affinity 
TopologyVersion [topVer=1, minorTopVer=1], super=DiscoveryEvent [evtNode=TcpDisc 
overyNode [id=07fd3596-3660-46ac-a79c-8e3da290a945, addrs=[0:0:0:0:0:0:0:1, 127. 
0.0.1, 164.55.146.204, 172.17.26.16, 192.168.56.1], sockAddrs=[CHMATHISPC.pc.fac 
tset.com/164.55.146.204:47500, /0:0:0:0:0:0:0:1:47500, /127.0.0.1:47500, /172.17 
.26.16:47500, /192.168.56.1:47500], discPort=47500, order=1, intOrder=1, lastExc 
hangeTime=1501884001588, loc=true, ver=2.1.0#20170720-sha1:bdaeecca, isClient=fa 
lse], topVer=1, nodeId8=07fd3596, msg=null, type=DISCOVERY_CUSTOM_EVT, tstamp=15 
01884004535]], crd=TcpDiscoveryNode [id=07fd3596-3660-46ac-a79c-8e3da290a945, ad 
drs=[0:0:0:0:0:0:0:1, 127.0.0.1, 164.55.146.204, 172.17.26.16, 192.168.56.1], so 
ckAddrs=[CHMATHISPC.pc.factset.com/164.55.146.204:47500, /0:0:0:0:0:0:0:1:47500, 
/127.0.0.1:47500, /172.17.26.16:47500, /192.168.56.1:47500], discPort=47500, or 
der=1, intOrder=1, lastExchangeTime=1501884001588, loc=true, ver=2.1.0#20170720- 
sha1:bdaeecca, isClient=false], exchId=GridDhtPartitionExchangeId [topVer=Affini 
tyTopologyVersion [topVer=1, minorTopVer=1], nodeId=07fd3596, evt=DISCOVERY_CUST 
OM_EVT], added=true, initFut=GridFutureAdapter [ignoreInterrupts=false, state=DO 
NE, res=false, hash=1673424663], init=false, lastVer=null, partReleaseFut=GridCo 
mpoundFuture [rdc=null, initFlag=1, lsnrCalls=4, done=true, cancelled=false, err 
=null, futs=[true, true, true, true]], exchActions=null, affChangeMsg=null, skip 
Preload=false, clientOnlyExchange=false, initTs=1501884004545, centralizedAff=fa 
lse, changeGlobalStateE=null, forcedRebFut=null, done=true, evtLatch=0, remainin 
g=[], super=GridFutureAdapter [ignoreInterrupts=false, state=DONE, res=java.lang 
.NullPointerException, hash=574566747]] 
class org.apache.ignite.IgniteCheckedException: null 
     at org.apache.ignite.internal.util.IgniteUtils.cast(IgniteUtils.java:722 
9) 
     at org.apache.ignite.internal.util.future.GridFutureAdapter.resolve(Grid 
FutureAdapter.java:258) 
     at org.apache.ignite.internal.util.future.GridFutureAdapter.get0(GridFut 
ureAdapter.java:206) 
     at org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutu 
reAdapter.java:158) 
     at org.apache.ignite.internal.processors.cache.GridCachePartitionExchang 
eManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1911) 
     at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java 
:110) 
     at java.lang.Thread.run(Thread.java:748) 
Caused by: java.lang.NullPointerException 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.applyUpdate(GridCacheDatabaseSharedManager.java:1620) 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.applyLastUpdates(GridCacheDatabaseSharedManager.java:1492) 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.restoreState(GridCacheDatabaseSharedManager.java:929) 
     at org.apache.ignite.internal.processors.cache.persistence.GridCacheData 
baseSharedManager.beforeExchange(GridCacheDatabaseSharedManager.java:733) 
     at org.apache.ignite.internal.processors.cache.distributed.dht.preloader 
.GridDhtPartitionsExchangeFuture.distributedExchange(GridDhtPartitionsExchangeFu 
ture.java:994) 
     at org.apache.ignite.internal.processors.cache.distributed.dht.preloader 
.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:632) 
     at org.apache.ignite.internal.processors.cache.GridCachePartitionExchang 
eManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1901) 
     ... 2 more 

這裏是我的整個應用程序:

using System; 
using System.IO; 
using Apache.Ignite.Core; 
using Apache.Ignite.Core.PersistentStore; 

namespace ConsoleApplication1 { 
    internal class Program { 
     private static void Main(string[] args) { 
      var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); 
      var cfg = new IgniteConfiguration { 
       JvmClasspath = Path.Combine(basePath, "Libs"), 
       PersistentStoreConfiguration = new PersistentStoreConfiguration { 
        PersistentStorePath = Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location), "Work") 
       } 
      }; 
      var ignite = Ignition.Start(cfg); 
      ignite.SetActive(true); 

      var cache = ignite.GetOrCreateCache<Guid, string>("myCache"); 
      cache[Guid.NewGuid()] = "Hello, world!"; 
      Console.WriteLine("\nCache size: " + cache.GetSize()); 

      Console.ReadKey(); 
     } 
    } 
} 

package.config

<?xml version="1.0" encoding="utf-8"?> 
<packages> 
    <package id="Apache.Ignite" version="2.1.0" targetFramework="net461" /> 
</packages> 

的App.config

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <startup> 
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> 
    </startup> 
</configuration> 

回答

0

我已經轉載了這個問題。如果你看一下默認點燃工作的目錄結構,它看起來像這樣:

- marshaller 
- db 
    - wal 
    - 0_0_0_0_0_0_0_1_127_0_0_1_... 

這最後的目錄可以通過PersistentStorePath config屬性被重新定義。 看起來你已經開始你的程序一次,然後停下來,清理那個特定的目錄,但不是wal

這會導致Ignite Persistent Storage不一致狀態並導致異常。

異常肯定是沒有意義可言,我已經提交了一個錯誤:https://issues.apache.org/jira/browse/IGNITE-6322


的「修復」你是重新定義IgniteConfiguration.WorkDirectory並在需要時完全清潔。