无法等待初始分区映射交换

时间:2017-08-17 02:00:20

标签: ignite

更改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
   - apache点燃2.1.0

这是我在java代码中的完整配置。(我在春天使用嵌入式点火)
我使用分区缓存,使用spring data 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 = false

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;

repository,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);
  }

}

由spring数据jpa实现的RdbmsCachePersistenceRepository 当我逐行调试代码时,IgniteContext无法带来RdbmsCachePersistenceRepository

我不知道为什么

1 个答案:

答案 0 :(得分:0)

我解决了这个问题,但我不知道为什么会这样解决。

我在IgniteSpring.start之前添加了这个虚拟代码。

springApplicationCtx.getBean(RdbmsCachePersistenceRepository.class);  

我认为当ignite上下文获取bean时,spring资源bean没有被初始化。