Start multiple h2o cluster from within R Start multiple h2o cluster from within R r r

Start multiple h2o cluster from within R


EDIT: I've changed to intern=FALSE, in below examples, based on comments


You should just need to change directory; it is either that or not setting wait=FALSE (to run the command in the background).

launchH2O <- "java -Xmx1g -jar h2o.jar -name testCluster -nthreads 1 -port 54321"savewd <- setwd("/path/to/h2ojar/")system(command = launchH2O, intern =FALSE wait=FALSE)setwd(savewd)

The last line, and the assignment to savewd is just to preserve working directory. Alternatively this should also work:

launchH2O <- "java -Xmx1g -jar /path/to/h2ojar/h2o.jar -name testCluster -nthreads 1 -port 54321"system(command = launchH2O, intern =FALSE, wait=FALSE)

When on Linux, there is another way:

launchH2O <- "bash -c 'nohup java -Xmx1g -jar /path/to/h2ojar/h2o.jar -name testCluster -nthreads 1 -port 54321 &'"system(command = launchH2O, intern =FALSE)

(Because the last command explicitly puts it in the background, I don't think you need to set wait=FALSE.)