Apache Ignite静态IP节点发现

时间:2017-06-28 15:58:23

标签: amazon-ec2 ignite

我正在构建一个使用静态IP发现而不是多播IP发现的Apache Ignite集群(在AWS EC2中)。

我的配置如此(https://apacheignite.readme.io/docs/cluster-config#static-ip-based-discovery):

 <property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
      <property name="ipFinder">
        <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
          <property name="addresses">
            <list>
              <value>host1.example.com</value>
              <value>host2.example.com</value>
              <value>host3.example.com</value>
            </list>
          </property>
        </bean>
      </property>
    </bean>
  </property>

当我启动节点时,我可以看到以下错误:

[15:04:36,385] [警告] [主要] [TcpDiscoverySpi]无法连接到IP finder的任何地址(确保IP查找程序地址正确并且所有主机上都禁用了防火墙):[host1.example .com / 10.0.21.223:47501,host2.example.com/10.0.21.207:47501,host3.example.com/10.0.21.191:47501]

从中我可以看到Ignite已经正确地将主机名解析为ip地址,但它无法连接以形成群集。这些主机都在AWS EC2中的同一子网中,我已经验证端口47500是否在它们之间打开(我不确定47501引用是什么)。

我也尝试过只使用ip地址而不是主机名,但结果是一样的。

我在这里错过了什么吗?

请注意,Ignite在每台服务器上作为Docker容器运行。 Ignite所需的TCP端口已公开并正常运行。

完整日志:

[15:55:18,231][INFO][main][IgniteKernal] Config URL: file:/apache-ignite-fabric-1.6.0-bin/config/default-config.xml
[15:55:18,231][INFO][main][IgniteKernal] Daemon mode: off
[15:55:18,231][INFO][main][IgniteKernal] OS: Linux 4.4.19-29.55.amzn1.x86_64 amd64
[15:55:18,231][INFO][main][IgniteKernal] OS user: root
[15:55:18,231][INFO][main][IgniteKernal] Language runtime: Java Platform API Specification ver. 1.8
[15:55:18,232][INFO][main][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
[15:55:18,233][INFO][main][IgniteKernal] VM total memory: 3.0GB
[15:55:18,233][INFO][main][IgniteKernal] Remote Management [restart: on, REST: on, JMX (remote: on, port: 49112, auth: off, ssl: off)]
[15:55:18,233][INFO][main][IgniteKernal] IGNITE_HOME=/apache-ignite-fabric-1.6.0-bin
[15:55:18,233][INFO][main][IgniteKernal] VM arguments: [-Xms1g, -Xmx1g, -XX:+AggressiveOpts, -XX:MaxMetaspaceSize=256m, -DIGNITE_QUIET=true, -DIGNITE_SUCCESS_FILE=/apache-ignite-fabric-1.6.0-bin/work/ignite_success_a8723f31-1954-4ea4-b190-762a36088140, -Dcom.sun.management.jmxremote, -Dcom.sun.management.jmxremote.port=49112, -Dcom.sun.management.jmxremote.authenticate=false, -Dcom.sun.management.jmxremote.ssl=false, -DIGNITE_HOME=/apache-ignite-fabric-1.6.0-bin, -DIGNITE_PROG_NAME=/apache-ignite-fabric-1.6.0-bin/bin/ignite.sh, -Xmx3g, -XX:+UseG1GC]
[15:55:18,234][INFO][main][IgniteKernal] Configured caches ['ignite-marshaller-sys-cache', 'ignite-sys-cache', 'ignite-atomics-sys-cache']
[15:55:18,234][WARNING][main][IgniteKernal] Peer class loading is enabled (disable it in production for performance and deployment consistency reasons)
[15:55:18,238][INFO][main][IgniteKernal] 3-rd party licenses can be found at: /apache-ignite-fabric-1.6.0-bin/libs/licenses
[15:55:18,284][INFO][main][IgniteKernal] Non-loopback local IPs: 172.17.0.2, fe80:0:0:0:42:acff:fe11:2%eth0
[15:55:18,284][INFO][main][IgniteKernal] Enabled local MACs: 0242AC110002
[15:55:18,294][INFO][main][IgnitePluginProcessor] Configured plugins:
[15:55:18,295][INFO][main][IgnitePluginProcessor]   ^-- None
[15:55:18,295][INFO][main][IgnitePluginProcessor]
[15:55:18,347][INFO][main][TcpCommunicationSpi] IPC shared memory server endpoint started [port=48100, tokDir=/apache-ignite-fabric-1.6.0-bin/work/ipc/shmem/cb41f1a5-d2f5-453d-a1c5-e008c1e12d2a-62]
[15:55:18,348][INFO][main][TcpCommunicationSpi] Successfully bound shared memory communication to TCP port [port=48100, locHost=0.0.0.0/0.0.0.0]
[15:55:18,362][INFO][main][TcpCommunicationSpi] Successfully bound to TCP port [port=47100, locHost=0.0.0.0/0.0.0.0]
[15:55:18,383][WARNING][main][NoopCheckpointSpi] Checkpoints are disabled (to enable configure any GridCheckpointSpi implementation)
[15:55:18,405][WARNING][main][GridCollisionManager] Collision resolution is disabled (all jobs will be activated upon arrival).
[15:55:18,408][WARNING][main][NoopSwapSpaceSpi] Swap space is disabled. To enable use FileSwapSpaceSpi.
[15:55:18,409][INFO][main][IgniteKernal] Security status [authentication=off, tls/ssl=off]
[15:55:18,652][INFO][main][GridTcpRestProtocol] Command protocol successfully started [name=TCP binary, host=0.0.0.0/0.0.0.0, port=11211]
[15:55:18,719][INFO][main][TcpDiscoverySpi] Successfully bound to TCP port [port=47500, localHost=0.0.0.0/0.0.0.0]
[15:55:21,746][WARNING][main][TcpDiscoverySpi] Failed to connect to any address from IP finder (make sure IP finder addresses are correct and firewalls are disabled on all host machines): [/10.0.21.191:47500, /10.0.21.207:47500, /10.0.21.223:47500]

4 个答案:

答案 0 :(得分:0)

点燃的默认端口是47500,但是在日志中,您可以看到它尝试连接到47501:

尝试在地址列表中指定一个端口:

<value>host1.example.com:47500</value>

还要查看此文档:https://apacheignite.readme.io/v2.0/docs/aws-deployment它对您的案例非常有用。

答案 1 :(得分:0)

首先,我建议将Ignite从1.6更新为1.9。

其次,指定端口,如建议here

使用--net = host运行您的docker,因此容器内的应用程序将看到来自主机的网络接口。这应该有所帮助。

此外,还可以配置special S3 IpFinder

答案 2 :(得分:0)

如果我的上一个答案中的设置不起作用,那么可能是因为您的IP可能不稳定。 根据Ignite docs AWS云上的节点发现通常被证明更具挑战性。与大多数其他虚拟环境一样,Amazon EC2具有以下限制:

禁用多播。 每次启动新映像时,TCP地址都会更改。 虽然您可以在没有多播的情况下使用基于TCP的发现,但您仍然需要处理不断变化的IP地址并不断更新配置。这产生了很大的不便,并且使得基于静态IP的配置在这样的环境中实际上不可用。 有关基于Amazon S3的发现,请参阅此链接 https://apacheignite.readme.io/v1.1/docs/aws-config#section-amazon-s3-based-discovery

答案 3 :(得分:-1)

DiscoverySPI上的setLocalAddress和setLocalPort

<!-- Initial local port to listen to. -->
        <property name="localPort" value="yourport"/>
    <!-- Initial local address for discovery . -->
        <property name="localAddress" value="yourhost"/>

        <!-- Changing local port range. This is an optional action. -->
        <property name="localPortRange" value="20"/>

并使用您在IPFinder上指定的地址列表中的相同端口。

<bean 
 class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                    <property name="addresses">
                        <list>
                            <value>yourhost:yourport</value>
                            <value>otherhost:otherhostport</value>
                        </list>
                    </property>
                </bean>

好的所有这些都应该与TCPVmIPfinder一起使用。