I have two EC2 machines: master and slave. SSH keys are generated for user ubuntu
and saved to ~/.ssh/authorized_keys
on both machines. Thus I can use the cluster from master node as ubuntu
user like this:
library(doSNOW)
cluster_options <-
c(rep(list(
list(host = "ec2-xx-xx-xx-xx.compute-1.amazonaws.com",
snowlib = "/usr/local/lib/R/site-library")), 2))
cl <- makeCluster(cluster_options, type = "SOCK")
clusterApply(cl, 1:2, get("+"), 3)
stopCluster(cl)
But when I call it via openCPU
it gives permission denied
message.
Currently I'm thinking about two possible solutions:
- Add SSH keys for
opencpu
user. But I don't have idea how to do it asopencpu
is non-interactive user - Make slaves accessible by master without any SSH keys
I'd prefer the first way and definitely need help here. But second way is also ok.