Reputation: 1
Is it possible to start both client and server nodes in the same JVM?
Upvotes: 0
Views: 1121
Reputation: 8390
Yes, you can start several nodes within one JVM. You only need to make sure that IgniteConfiguration.getGridName()
property is unique for each node. Here is the example:
public static void main(String[] args) {
Ignite server = startNode("server-node");
Ignite client = startNode("client-node");
...
}
private static Ignite startNode(String name) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setGridName(name);
return Ignition.start(cfg);
}
Upvotes: 1