Setting Up Ignite Grids on the Same Netmask

classic Classic list List threaded Threaded
2 messages Options
Kevin Daly Kevin Daly
Reply | Threaded
Open this post in threaded view
|

Setting Up Ignite Grids on the Same Netmask

I am trying to set up our Ignite Grids so that they don't see each other.. For example if I have 2 grids of different names, they see each other.. And this is causing a problem because the have different classes loaded.

This is in a development environment where there are different developers running 3 node clusters on their local machines.
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Setting Up Ignite Grids on the Same Netmask

Hi Kevin,

Grid name is actually just a local name of your Ignite instance, it can be used to get this instance via Ignition.ignite(..) method. It's useful when you have several nodes in one JVM (such deployment is usually used only in testing environment).

To create two isolated clusters, you have to properly configure discovery IP finder. E.g., in case of multicast you can provide different multicast groups. Nodes with different groups will never discover each other:

<property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
        <property name="ipFinder">
            <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                <property name="multicastGroup" value="228.1.2.4"/>
            </bean>
        </property>
    </bean>
</property>

If you're using VM IP finder with explicit list of IPs, you can provide different range of ports. E.g., for the first cluster:

<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>127.0.0.1:47500..47509</value>
                    </list>
                </property>
            </bean>
        </property>
    </bean>
</property>

And for the second one:

<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>127.0.0.1:47600..47609</value>
                    </list>
                </property>
            </bean>
        </property>
    </bean>
</property>

Hope this helps.

-Val