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

走远了吗. 提交于 2019-12-11 15:08:08

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/57369442/how-to-run-multiple-apache-ignite-nodes-in-the-same-machine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!