I'm trying to understand how one can run Hadoop applications using Gridgain in a single JVM context, using the in-memory accelerator.
I've seen some hints of how this can be done programmatically as in here. However after trying to run this example in eclipse this error came up:
Exception in thread "main" class org.gridgain.grid.GridIllegalStateException: Grid instance was not properly started or was already stopped: jvm-node-0
at org.gridgain.grid.kernal.GridGainEx.grid(GridGainEx.java:995)
at org.gridgain.grid.GridGain.grid(GridGain.java:395)
at test.GridJvmCloudExample.main(GridJvmCloudExample.java:66)
The only modification that I made was changing line 38 to GridConfiguration cfg = new GridConfiguration();
. Any clue of what I can do? It must be said that was not running any other node at the time.
But my objective is to use the scripts. In other words to run GridGain as bin/ggstart.sh, launching multiple node that share the same JVM. Is there any way of doing this? The version that I'm using is 6.6.4.
Thanks in advance!
I tried to run the example and it works for me. This error actually means that at least one of the nodes (the one with name jvm-node-0
) didn't start. I think there was some exception during start which was not shown because it's executed in a thread pool. I suggest to surround G.start(cfg)
call with try-catch and print the stack trace.
As for starting from scripts, you can create your own main class which will start nodes you need (like it's done in example) and set it's full name into MAIN_CLASS
environment variable. ggstart.sh
will automatically use it instead of the default main class, which always starts only one node per VM.