Я запускаю Apache Зажигать экземпляр в тестовом контейнере, как показано ниже:
GenericContainer<?> apacheIgniteContainer =new GenericContainer<>("apacheignite/ignite")
.withExposedPorts(10800, 47100, 47500);
apacheIgniteContainer.setPortBindings(Arrays.asList("10800:10800", "47100:47100", "47500:47500"));
apacheIgniteContainer.start();
, и это моя конфигурация:
@Bean
public Ignite igniteInstance() {
return Ignition.start(igniteConfiguration());
}
private IgniteConfiguration igniteConfiguration() {
IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
igniteConfiguration.setFailureDetectionTimeout(DEFAULT_TIMEOUT);
igniteConfiguration.setDiscoverySpi(tcpDiscoverySpi());
igniteConfiguration.setClientMode(false);
igniteConfiguration.setCacheConfiguration(cacheConfiguration());
igniteConfiguration.setLocalHost(LOCALHOST);
TcpCommunicationSpi communicationSpi = new TcpCommunicationSpi();
communicationSpi.setLocalAddress(LOCALHOST);
igniteConfiguration.setCommunicationSpi(communicationSpi);
return igniteConfiguration;
}
private TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder() {
TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder(true);
tcpDiscoveryVmIpFinder.setAddresses((Arrays.asList(LOCALHOST)));
return tcpDiscoveryVmIpFinder;
}
private TcpDiscoverySpi tcpDiscoverySpi() {
TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder());
tcpDiscoverySpi.setLocalAddress(LOCALHOST);
tcpDiscoverySpi.setLocalPort(10800);
return tcpDiscoverySpi;
}
private CacheConfiguration cacheConfiguration() {
CacheConfiguration cacheConfiguration = new CacheConfiguration("exampleCache");
cacheConfiguration.setIndexedTypes(Long.class, Example.class);
return cacheConfiguration;
}
И проблема в том, что я передаю только LOCALHOST обнаруживать / услуги связи, но каждый раз, когда начинается тест интеграции, регистрируются неправильные IP-адреса. Вот журналы:
07:20:21.376 [exchange-worker-#48] WARN [] o.a.i.s.c.t.TcpCommunicationSpi - Connect timed out (consider increasing 'failureDetectionTimeout' configuration property) [addr=/172.17.0.5:47100, failureDetectionTimeout=30000]
07:20:40.267 [main] WARN [] o.a.i.i.p.c.GridCachePartitionExchangeManager - Still waiting for initial partition map exchange [fut=GridDhtPartitionsExchangeFuture [firstDiscoEvt=DiscoveryEvent [evtNode=TcpDiscoveryNode [id=3ad0b9b8-6f30-4e77-9874-e766dd266f15, addrs=[127.0.0.1], sockAddrs=[/127.0.0.1:0], discPort=0, order=2, intOrder=0, lastExchangeTime=1580970000048, loc=true, ver=2.7.6#20190911-sha1:21f7ca41, isClient=true], topVer=2, nodeId8=3ad0b9b8, msg=null, type=NODE_JOINED, tstamp=1580970000227], crd=TcpDiscoveryNode [id=ae6dd269-fbb8-413e-ad2e-7ed9e2ae2495, addrs=[127.0.0.1, 172.17.0.5], sockAddrs=[/172.17.0.5:47500, 624f07442eab/52.18.154.42:47500, /127.0.0.1:47500], discPort=47500, order=1, intOrder=1, lastExchangeTime=1580970000164, loc=false, ver=2.7.6#20190911-sha1:21f7ca41, isClient=false], exchId=GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=2, minorTopVer=0], discoEvt=DiscoveryEvent [evtNode=TcpDiscoveryNode [id=3ad0b9b8-6f30-4e77-9874-e766dd266f15, addrs=[127.0.0.1], sockAddrs=[/127.0.0.1:0], discPort=0, order=2, intOrder=0, lastExchangeTime=1580970000048, loc=true, ver=2.7.6#20190911-sha1:21f7ca41, isClient=true], topVer=2, nodeId8=3ad0b9b8, msg=null, type=NODE_JOINED, tstamp=1580970000227], nodeId=3ad0b9b8, evt=NODE_JOINED], added=true, initFut=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=337147080], init=false, lastVer=null, partReleaseFut=null, exchActions=ExchangeActions [startCaches=null, stopCaches=null, startGrps=[], stopGrps=[], resetParts=null, stateChangeRequest=null], affChangeMsg=null, initTs=1580970000258, centralizedAff=false, forceAffReassignment=false, exchangeLocE=null, cacheChangeFailureMsgSent=false, done=false, state=CLIENT, registerCachesFuture=null, partitionsSent=false, partitionsReceived=false, delayedLatestMsg=null, afterLsnrCompleteFut=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=441482912], evtLatch=0, remaining=[ae6dd269-fbb8-413e-ad2e-7ed9e2ae2495], super=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=114452799]]]
...
07:20:42.396 [exchange-worker-#48] WARN [] o.a.i.s.c.t.TcpCommunicationSpi - Connect timed out (consider increasing 'failureDetectionTimeout' configuration property) [addr=624f07442eab/52.18.154.42:47100, failureDetectionTimeout=30000]
07:20:42.430 [grid-nio-worker-tcp-comm-0-#32] INFO [] o.a.i.s.c.t.TcpCommunicationSpi - Established outgoing communication connection [locAddr=/127.0.0.1:59666, rmtAddr=/127.0.0.1:47100]
Итак, сначала он пытается соединиться с: 172.17.0.5:47100 (я понятия не имею, откуда этот адрес) и это не удается. После этого он пытается подключиться к правильному IP (localhost), а затем проходит тестирование. Поэтому мой вопрос - почему он пытается подключиться к первому IP (172.17.0.5:47100) - я даже не указал его.