ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jimfcarroll <jimfcarr...@gmail.com>
Subject Re: Ignite in Docker
Date Wed, 18 Jan 2017 20:44:44 GMT
Hi Val,

Thanks for the response. The AddressResolver is pretty simple. It's
initialized with a map of internal to external IPs (currently the map has a
single entry). The the main getExternalAddress(final InetSocketAddress addr)
looks like this:

        try {
            LOGGER.debug("{} Looking up external address {}", ths, addr);

            String addrString = addr.getAddress().getHostAddress();
            if (addrString.startsWith("/")) {
                addrString = addrString.substring(1, addrString.length());
            }
            final String ret = resolution.get(addrString);

            LOGGER.debug("{} ... which resolved to {}", ths, ret);
 
            final Collection<InetSocketAddress> ret1 = Arrays.asList(ret ==
null ? addr : makeSocketAddr(addr, ret));
            if (ret != null) 
                LOGGER.debug("{}    ... final result {}", ths, ret1);
            return ret1;
        } catch (final UnknownHostException uhe) {
            throw new IgniteCheckedException(uhe);
        }

Note: 'ths' is an instance count sequence provided from a static
AtomicInteger for debug purposes only.

I have this plugged in using Spring (the class is called
DockerIgniteServerAddressResolver. Package names redacted):

  <bean id="grid.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
    <property name="discoverySpi">
      <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
        <property name="addressResolver">
          <bean class="com....DockerIgniteServerAddressResolver" />
        </property>
      </bean>
    </property>
    <property name="communicationSpi">
      <bean
class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
        <property name="addressResolver">
          <bean class="com...DockerIgniteServerAddressResolver" />
        </property>
      </bean>
    </property>
    <property name="addressResolver">
      <bean class="com....DockerIgniteServerAddressResolver" />
    </property>
  </bean>
</beans>

I tried this plugging the resolver into different places. It wasn't
originally provided in all 3.

This is server configuration only. If I run 1 server and 1 client it seems
okay. If I run a 2nd server I get the following repeatedly in ONE of the
servers (and the client- if it's running):

[16:59:05] Topology snapshot [ver=24004, servers=2, clients=0, CPUs=8,
heap=7.1GB]
[16:59:05] Topology snapshot [ver=24005, servers=1, clients=0, CPUs=4,
heap=3.6GB]

This repeats every second or so.

If I do a curl host:port/ignite?cmd=top I see the INTERNAL addresses in
tcpAddresses. I followed through the code and can see this is the case, even
though the external addresses are available in the code that sets the bean
values, so I'm assuming that's the intention.

I'm running 1.8.0.

Thanks
Jim








--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-in-Docker-tp10120p10125.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message