-
-
Save arnaudsj/3310773 to your computer and use it in GitHub Desktop.
starCluster R plugin for doRedis implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from starcluster.clustersetup import ClusterSetup | |
from starcluster.logger import log | |
class doRedis(ClusterSetup): | |
def __init__(self): | |
pass | |
def run(self, nodes, master, user, user_shell, volumes): | |
redis_master_ip = master.private_ip_address | |
command = """su - arnaudsj -c "nohup R --slave -e 'require(multicore);require(doRedis);startLocalWorkers(n=multicore:::detectCores(),host=\\\"%s\\\",queue=\\\"jobs\\\", port=6379)' > /dev/null 2>&1 &" """ % redis_master_ip | |
for node in nodes: | |
if node.alias != "master": | |
log.info("Running on %s => %s" % (node.alias, command)) | |
node.ssh.execute_async(command) | |
print "ssh -CL 9999:127.0.0.1:6379 root@%s -N" % master.public_dns_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment