Hi,
I wrote an aws ELB based tcp discovery ip finder. When I launched two ec2
nodes in the same target group, the ip finder found node IPs correctly.
However, affinity recalculation wasn't triggered. Basically nothing
happened. also no exception. If I ran two nodes locally with multicast,
affinity recalculation worked properly. I just wonder what else I need
to do to make the custom IP finder works?
Here is the overrided method in IPFinder. Basically it just is a slightly
modified version of TcpDiscoveryElbIpFinder
@Override public Collection<InetSocketAddress>
getRegisteredAddresses() throws IgniteSpiException {
initClients();
logger.debug("elb host discovery");
List<String> privateIPs =
awsService.getHealthyPrivateIPsFromTarget(targetGroupArn);
List<InetSocketAddress> addrs = new ArrayList<>();
for (String privateIP : privateIPs) {
logger.debug("tcp discovery. found host "+privateIP);
addrs.add(new InetSocketAddress(privateIP, 0));
}
return addrs;
}
@Override public void registerAddresses(Collection<InetSocketAddress>
addrs) throws IgniteSpiException {
//No-op, ELB will take care of registration.
}
@Override public void
unregisterAddresses(Collection<InetSocketAddress> addrs) throws
IgniteSpiException {
// No-op, ELB will take care of this process.
}
And here is the ignite config setting
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(getTcpELBIpFinder(elbDiscoveryConfig));
IgniteConfiguration igniteConfig = new IgniteConfiguration();
igniteConfig.setMetricsLogFrequency(0);
igniteConfig.setDiscoverySpi(spi);
DataStorageConfiguration storageCfg = new DataStorageConfiguration();
storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(false);
igniteConfig.setDataStorageConfiguration(storageCfg);
Any ideas?
Thanks
Ken