2017-08-17 37 views
2

將apache Ignite 2.0更改爲2.1後,我得到了警告。未能等待初始分區映射交換

2017-08-17 10:44:21.699 WARN 10884 --- [   main] .i.p.c.GridCachePartitionExchangeManager : Failed to wait for initial partition map exchange. Possible reasons are: 

我使用第三方持久性緩存存儲。
當我刪除cacheStore配置,我沒有得到警告。工作正常。
使用cacheStore並將版本2.1更改爲2.0,我沒有收到警告。工作正常。

2.1是否有重大變化?

這裏是我的完整框架堆棧。
- 春天開機1.5.6
- 彈簧數據的JPA
- 阿帕奇點燃2.1.0

這裏是我在Java代碼中滿配置(我用的春季嵌入式點燃)
我使用分區的高速緩存。使用彈簧數據jpa將緩存寫入rdbms存儲。

IgniteConfiguration igniteConfig = new IgniteConfiguration(); 
CacheConfiguration<Long, Object> cacheConfig = new CacheConfiguration<>(); 

cacheConfig.setCopyOnRead(false); //for better performance 
cacheConfig 
     .setWriteThrough(true) 
     .setWriteBehindEnabled(true) 
     .setWriteBehindBatchSize(1024) 
     .setWriteBehindFlushFrequency(10000) 
     .setWriteBehindCoalescing(true) 
     .setCacheStoreFactory(new CacheStoreImpl()); //CacheStoreImpl use spring data jpa internally 

cacheConfig.setName('myService'); 
cacheConfig.setCacheMode(CacheMode.PARTITIONED); 
cacheConfig.setBackups(2); 
cacheConfig.setWriteSynchronizationMode(FULL_ASYNC); 

cacheConfig.setNearConfiguration(new NearCacheConfiguration<>());//use default configuration 


igniteConfig.setCacheConfiguration(cacheConfig); 

igniteConfig.setMemoryConfiguration(new MemoryConfiguration() 
     .setPageSize(8 * 1024) 
     .setMemoryPolicies(new MemoryPolicyConfiguration() 
      .setInitialSize((long) 256L * 1024L * 1024L) 
      .setMaxSize((long) 1024L * 1024L * 1024L))); 

Ignite ignite = IgniteSpring.start(igniteConfig, springApplicationCtx); 
ignite.active(true); 

這裏是我使用-DIGNITE_QUITE =假

2017-08-18 11:54:52.587 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Config URL: n/a 
2017-08-18 11:54:52.587 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Daemon mode: off 
2017-08-18 11:54:52.587 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : OS: Windows 10 10.0 amd64 
2017-08-18 11:54:52.587 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : OS user: user 
2017-08-18 11:54:52.588 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : PID: 684 
2017-08-18 11:54:52.588 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Language runtime: Java Platform API Specification ver. 1.8 
2017-08-18 11:54:52.588 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : VM information: Java(TM) SE Runtime Environment 1.8.0_131-b11 Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.131-b11 
2017-08-18 11:54:52.588 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : VM total memory: 1.9GB 
2017-08-18 11:54:52.589 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Remote Management [restart: off, REST: on, JMX (remote: on, port: 58771, auth: off, ssl: off)] 
2017-08-18 11:54:52.589 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : IGNITE_HOME=null 
2017-08-18 11:54:52.589 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : VM arguments: [-Dcom.sun.management.jmxremote, -Dcom.sun.management.jmxremote.port=58771, -Dcom.sun.management.jmxremote.authenticate=false, -Dcom.sun.management.jmxremote.ssl=false, -Djava.rmi.server.hostname=localhost, -Dspring.liveBeansView.mbeanDomain, -Dspring.application.admin.enabled=true, -Dspring.profiles.active=rdbms,multicastIp, -Dapi.port=10010, -Xmx2g, -Xms2g, -DIGNITE_QUIET=false, -Dfile.encoding=UTF-8, -Xbootclasspath:C:\Program Files\Java\jre1.8.0_131\lib\resources.jar;C:\Program Files\Java\jre1.8.0_131\lib\rt.jar;C:\Program Files\Java\jre1.8.0_131\lib\jsse.jar;C:\Program Files\Java\jre1.8.0_131\lib\jce.jar;C:\Program Files\Java\jre1.8.0_131\lib\charsets.jar;C:\Program Files\Java\jre1.8.0_131\lib\jfr.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\cldrdata.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\dnsns.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\jaccess.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\jfxrt.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\localedata.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\nashorn.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\sunec.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\sunmscapi.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jre1.8.0_131\lib\ext\zipfs.jar] 
2017-08-18 11:54:52.589 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : System cache's MemoryPolicy size is configured to 40 MB. Use MemoryConfiguration.systemCacheMemorySize property to change the setting. 
2017-08-18 11:54:52.589 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Configured caches [in 'sysMemPlc' memoryPolicy: ['ignite-sys-cache'], in 'default' memoryPolicy: ['myCache']] 
2017-08-18 11:54:52.592 WARN 684 --- [ pub-#11%null%] o.apache.ignite.internal.GridDiagnostic : This operating system has been tested less rigorously: Windows 10 10.0 amd64. Our team will appreciate the feedback if you experience any problems running ignite in this environment. 
2017-08-18 11:54:52.657 INFO 684 --- [   main] o.a.i.i.p.plugin.IgnitePluginProcessor : Configured plugins: 
2017-08-18 11:54:52.657 INFO 684 --- [   main] o.a.i.i.p.plugin.IgnitePluginProcessor : ^-- None 
2017-08-18 11:54:52.657 INFO 684 --- [   main] o.a.i.i.p.plugin.IgnitePluginProcessor : 
2017-08-18 11:54:52.724 INFO 684 --- [   main] o.a.i.s.c.tcp.TcpCommunicationSpi  : Successfully bound communication NIO server to TCP port [port=47100, locHost=0.0.0.0/0.0.0.0, selectorsCnt=4, selectorSpins=0, pairedConn=false] 
2017-08-18 11:54:52.772 WARN 684 --- [   main] o.a.i.s.c.tcp.TcpCommunicationSpi  : Message queue limit is set to 0 which may lead to potential OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due to message queues growth on sender and receiver sides. 
2017-08-18 11:54:52.787 WARN 684 --- [   main] o.a.i.s.c.noop.NoopCheckpointSpi   : Checkpoints are disabled (to enable configure any GridCheckpointSpi implementation) 
2017-08-18 11:54:52.811 WARN 684 --- [   main] o.a.i.i.m.c.GridCollisionManager   : Collision resolution is disabled (all jobs will be activated upon arrival). 
2017-08-18 11:54:52.812 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Security status [authentication=off, tls/ssl=off] 
2017-08-18 11:54:53.087 INFO 684 --- [   main] o.a.i.i.p.odbc.SqlListenerProcessor  : SQL connector processor has started on TCP port 10800 
2017-08-18 11:54:53.157 INFO 684 --- [   main] o.a.i.i.p.r.p.tcp.GridTcpRestProtocol : Command protocol successfully started [name=TCP binary, host=0.0.0.0/0.0.0.0, port=11211] 
2017-08-18 11:54:53.373 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Non-loopback local IPs: 192.168.183.206, 192.168.56.1, 2001:0:9d38:6abd:30a3:1c57:3f57:4831, fe80:0:0:0:159d:5c82:b4ca:7630%eth2, fe80:0:0:0:30a3:1c57:3f57:4831%net0, fe80:0:0:0:3857:b492:48ad:1dc%eth4 
2017-08-18 11:54:53.373 INFO 684 --- [   main] org.apache.ignite.internal.IgniteKernal : Enabled local MACs: 00000000000000E0, 0A0027000004, BCEE7B8B7C00 
2017-08-18 11:54:53.404 INFO 684 --- [   main] o.a.i.spi.discovery.tcp.TcpDiscoverySpi : Successfully bound to TCP port [port=47500, localHost=0.0.0.0/0.0.0.0, locNodeId=7d90a0ac-b620-436f-b31c-b538a04b0919] 
2017-08-18 11:54:53.409 WARN 684 --- [   main] .s.d.t.i.m.TcpDiscoveryMulticastIpFinder : TcpDiscoveryMulticastIpFinder has no pre-configured addresses (it is recommended in production to specify at least one address in TcpDiscoveryMulticastIpFinder.getAddresses() configuration property) 
2017-08-18 11:54:55.068 INFO 684 --- [orker-#34%null%] o.apache.ignite.internal.exchange.time : Started exchange init [topVer=AffinityTopologyVersion [topVer=1, minorTopVer=0], crd=true, evt=10, node=TcpDiscoveryNode [id=7d90a0ac-b620-436f-b31c-b538a04b0919, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1, 192.168.183.206, 192.168.56.1, 2001:0:9d38:6abd:30a3:1c57:3f57:4831], sockAddrs=[/192.168.183.206:47500, DESKTOP-MDB6VIL/192.168.56.1:47500, /0:0:0:0:0:0:0:1:47500, /127.0.0.1:47500, /2001:0:9d38:6abd:30a3:1c57:3f57:4831:47500], discPort=47500, order=1, intOrder=1, lastExchangeTime=1503024893396, loc=true, ver=2.1.0#20170721-sha1:a6ca5c8a, isClient=false], evtNode=TcpDiscoveryNode [id=7d90a0ac-b620-436f-b31c-b538a04b0919, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1, 192.168.183.206, 192.168.56.1, 2001:0:9d38:6abd:30a3:1c57:3f57:4831], sockAddrs=[/192.168.183.206:47500, DESKTOP-MDB6VIL/192.168.56.1:47500, /0:0:0:0:0:0:0:1:47500, /127.0.0.1:47500, /2001:0:9d38:6abd:30a3:1c57:3f57:4831:47500], discPort=47500, order=1, intOrder=1, lastExchangeTime=1503024893396, loc=true, ver=2.1.0#20170721-sha1:a6ca5c8a, isClient=false], customEvt=null] 
2017-08-18 11:54:55.302 INFO 684 --- [orker-#34%null%] o.a.i.i.p.cache.GridCacheProcessor  : Started cache [name=ignite-sys-cache, memoryPolicyName=sysMemPlc, mode=REPLICATED, atomicity=TRANSACTIONAL] 
2017-08-18 11:55:15.066 WARN 684 --- [   main] .i.p.c.GridCachePartitionExchangeManager : Failed to wait for initial partition map exchange. Possible reasons are: 
    ^-- Transactions in deadlock. 
    ^-- Long running transactions (ignore if this is the case). 
    ^-- Unreleased explicit locks. 
2017-08-18 11:55:35.070 WARN 684 --- [   main] .i.p.c.GridCachePartitionExchangeManager : Still waiting for initial partition map exchange [fut=GridDhtPartitionsExchangeFuture [dummy=false, forcePreload=false, reassign=false, discoEvt=DiscoveryEvent [evtNode=TcpDiscoveryNode [id=7d90a0ac-b620-436f-b31c-b538a04b0919, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1, 192.168.183.206, 192.168.56.1, 2001:0:9d38:6abd:30a3:1c57:3f57:4831], sockAddrs=[/192.168.183.206:47500, DESKTOP-MDB6VIL/192.168.56.1:47500, /0:0:0:0:0:0:0:1:47500, /127.0.0.1:47500, /2001:0:9d38:6abd:30a3:1c57:3f57:4831:47500], discPort=47500, order=1, intOrder=1, lastExchangeTime=1503024893396, loc=true, ver=2.1.0#20170721-sha1:a6ca5c8a, isClient=false], topVer=1, nodeId8=7d90a0ac, msg=null, type=NODE_JOINED, tstamp=1503024895045], crd=TcpDiscoveryNode [id=7d90a0ac-b620-436f-b31c-b538a04b0919, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1, 192.168.183.206, 192.168.56.1, 2001:0:9d38:6abd:30a3:1c57:3f57:4831], sockAddrs=[/192.168.183.206:47500, DESKTOP-MDB6VIL/192.168.56.1:47500, /0:0:0:0:0:0:0:1:47500, /127.0.0.1:47500, /2001:0:9d38:6abd:30a3:1c57:3f57:4831:47500], discPort=47500, order=1, intOrder=1, lastExchangeTime=1503024893396, loc=true, ver=2.1.0#20170721-sha1:a6ca5c8a, isClient=false], exchId=GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=1, minorTopVer=0], nodeId=7d90a0ac, evt=NODE_JOINED], added=true, initFut=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=1821989981], init=false, lastVer=null, partReleaseFut=null, exchActions=null, affChangeMsg=null, skipPreload=false, clientOnlyExchange=false, initTs=1503024895057, centralizedAff=false, changeGlobalStateE=null, forcedRebFut=null, done=false, evtLatch=0, remaining=[], super=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=733156437]]] 

調試我的代碼,我想IgniteSpring不能注入SpringResource

@SpringResource(resourceClass = RdbmsCachePersistenceRepository.class) 
    private RdbmsCachePersistenceRepository repository; 

    @SpringResource(resourceClass = RdbmsCachePersistenceRepository.class) 
    private CacheObjectFactory cacheObjectFactory; 

庫,cacheObjectFactory是相同的完整日誌像下面的代碼

public interface RdbmsCachePersistenceRepository extends 
    JpaRepository<RdbmsCachePersistence, Long>, 
    CachePersistenceRepository<RdbmsCachePersistence>, 
    CacheObjectFactory { 

    @Override 
    default CachePersistence createCacheObject(long key, Object value, int partition) { 
    return new RdbmsCachePersistence(key, value, partition); 
    } 

} 

而且RdbmsCachePersistenceRepository彈簧數據的JPA實現
當我通過線調試的代碼行,IgniteContext不能帶來RdbmsCachePersistenceRepository

我不知道爲什麼它是

+0

請使用'-DIGNITE_QUIET = false'系統屬性集共享完整日誌。 順便說一句,設置'cacheConfig.setCopyOnRead(false)'只在只讀情況下才是安全的。 – alexfedotov

+0

@alexfedotov我附上了 –

回答

0

我解決這個問題,但我不不知道爲什麼它解決了。

我在IgniteSpring.start之前添加了這個虛擬代碼。

springApplicationCtx.getBean(RdbmsCachePersistenceRepository.class); 

我覺得spring資源bean在ignite上下文獲取bean時沒有初始化。

+0

你在哪裏注射@SpringResource? 您是否嘗試過[IgniteSpringBean(https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteSpringBean.html) '@Bean 公共IgniteSpringBean igniteSpringBean(){ IgniteSpringBean豆=新IgniteSpringBean(); bean.setConfiguration(igniteConfiguration()); return bean; }' – alexfedotov