awesomemypro
awesomemypro

Reputation: 561

How to run multiple Apache Ignite nodes in the same machine?

I want to run multiple Ignite nodes on the same VM. Suppose, their address will be localhost:port (a set of ports, as a series). And, I want my Java client application to connect to the nodes.

Can you provide a simple and beginner-level guide to achieve this? The ones I tried are overwhelming.

Upvotes: 1

Views: 1633

Answers (2)

dmagda
dmagda

Reputation: 1785

See this documentation section that shows how to start isolated clusters in the same environment.

Upvotes: 2

alamar
alamar

Reputation: 19313

public class MultipleIgnites {
    public static void main(String[] args) throws Exception {
        Ignition.start(new IgniteConfiguration().setIgniteInstanceName("s1")
            .setDataStorageConfiguration(new DataStorageConfiguration()
                .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))));
        Ignition.start(new IgniteConfiguration().setIgniteInstanceName("s2")
            .setDataStorageConfiguration(new DataStorageConfiguration()
                .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))));
        Ignition.start(new IgniteConfiguration().setIgniteInstanceName("s3")
            .setDataStorageConfiguration(new DataStorageConfiguration()
                .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))));
}

This will start three of them, connected in one cluster.

Upvotes: 2

Related Questions